<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perlapi - autogenerated documentation for the perl public API - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perlapi">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlapi.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perlapi">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perlapi">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perlapi">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perlapi">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perlapi">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perlapi">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perlapi">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perlapi">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perlapi">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perlapi">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perlapi">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perlapi">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perlapi">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perlapi">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perlapi">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perlapi">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perlapi">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perlapi">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perlapi">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perlapi">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perlapi">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perlapi">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perlapi">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perlapi">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perlapi">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perlapi">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perlapi">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perlapi">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perlapi">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perlapi">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perlapi">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perlapi">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perlapi">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perlapi">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perlapi">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perlapi">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perlapi">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perlapi">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perlapi">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perlapi">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perlapi">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perlapi">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perlapi">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perlapi">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perlapi">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perlapi">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perlapi">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perlapi">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perlapi">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perlapi">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perlapi">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perlapi">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perlapi">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perlapi">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perlapi">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perlapi">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perlapi">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perlapi">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perlapi">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perlapi">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perlapi">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perlapi">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perlapi">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perlapi">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perlapi">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perlapi">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perlapi">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perlapi">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perlapi">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perlapi">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perlapi">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perlapi">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perlapi">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perlapi">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perlapi">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perlapi">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perlapi">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perlapi">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perlapi">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perlapi">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlapi.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perlapi">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perlapi">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perlapi">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perlapi">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perlapi">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perlapi">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perlapi">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perlapi">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perlapi">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perlapi">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perlapi">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perlapi">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perlapi">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perlapi">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perlapi">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perlapi">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perlapi">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perlapi">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perlapi">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perlapi">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perlapi">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perlapi">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perlapi">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perlapi">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perlapi">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perlapi">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perlapi">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perlapi">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perlapi">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perlapi">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perlapi">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perlapi">5.35.1</a>
          <a class="dropdown-item active" href="perlapi.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlapi.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perlapi.html">perlapi</a>
          <div id="more">
            (<a href="perlapi.txt">source</a>,
            <a href="https://metacpan.org/pod/perlapi">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perlapi.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#DESCRIPTION">DESCRIPTION   </a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#AV-Handling">AV Handling</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Callback-Functions">Callback Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Casting">Casting</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Character-case-changing">Character case changing</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Character-classification">Character classification</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Compiler-and-Preprocessor-information">Compiler and Preprocessor information</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Compiler-directives">Compiler directives</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Compile-time-scope-hooks">Compile-time scope hooks</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Concurrency">Concurrency</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#COP-Hint-Hashes">COP Hint Hashes</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Custom-Operators">Custom Operators</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#CV-Handling">CV Handling</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Debugging">Debugging</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Display-functions">Display functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Embedding-and-Interpreter-Cloning">Embedding and Interpreter Cloning</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Errno">Errno</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Exception-Handling-(simple)-Macros">Exception Handling (simple) Macros</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Filesystem-configuration-values">Filesystem configuration values</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Floating-point-configuration-values">Floating point configuration values</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Formats">Formats</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#General-Configuration">General Configuration</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlapi.html#List-of-capability-HAS_foo-symbols">List of capability HAS_foo symbols</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#List-of-%23include-needed-symbols">List of #include needed symbols</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Global-Variables">Global Variables</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#GV-Handling">GV Handling</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Hook-manipulation">Hook manipulation</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#HV-Handling">HV Handling</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Input/Output">Input/Output</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Integer-configuration-values">Integer configuration values</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Lexer-interface">Lexer interface</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Locales">Locales</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Magic">Magic</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Memory-Management">Memory Management</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#MRO">MRO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Multicall-Functions">Multicall Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Numeric-Functions">Numeric Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Optree-construction">Optree construction</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Optree-Manipulation-Functions">Optree Manipulation Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Pack-and-Unpack">Pack and Unpack</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Pad-Data-Structures">Pad Data Structures</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Password-and-Group-access">Password and Group access</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Paths-to-system-commands">Paths to system commands</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Prototype-information">Prototype information</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#REGEXP-Functions">REGEXP Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Signals">Signals</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Site-configuration">Site configuration</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Sockets-configuration-values">Sockets configuration values</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Source-Filters">Source Filters</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Stack-Manipulation-Macros">Stack Manipulation Macros</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#String-Handling">String Handling</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#SV-Flags">SV Flags</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#SV-Handling">SV Handling</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Arena-allocator-API-Summary">Arena allocator API Summary</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Time">Time</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Typedef-names">Typedef names</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Unicode-Support">Unicode Support</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Utility-Functions">Utility Functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Versioning">Versioning</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Warning-and-Dieing">Warning and Dieing</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#XS">XS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#Undocumented-elements">Undocumented elements</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#AUTHORS">AUTHORS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlapi.html#SEE-ALSO">SEE ALSO</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perlapi.html#NAME">#</a>NAME</h1>

<p>perlapi - autogenerated documentation for the perl public API</p>

<h1 id="DESCRIPTION"><a class="permalink" href="perlapi.html#DESCRIPTION">#</a>DESCRIPTION   </h1>

<p>This file contains most of the documentation of the perl public API, as generated by <i>embed.pl</i>. Specifically, it is a listing of functions, macros, flags, and variables that may be used by extension writers. Besides <a href="perlintern.html">perlintern</a> and <i>config.h</i>, some items are listed here as being actually documented in another pod.</p>

<p><a href="perlapi.html#Undocumented-elements">At the end</a> is a list of functions which have yet to be documented. Patches welcome! The interfaces of these are subject to change without notice.</p>

<p>Some of the functions documented here are consolidated so that a single entry serves for multiple functions which all do basically the same thing, but have some slight differences. For example, one form might process magic, while another doesn&#39;t. The name of each variation is listed at the top of the single entry. But if all have the same signature (arguments and return type) except for their names, only the usage for the base form is shown. If any one of the forms has a different signature (such as returning <code>const</code> or not) every function&#39;s signature is explicitly displayed.</p>

<p>Anything not listed here or in the other mentioned pods is not part of the public API, and should not be used by extension writers at all. For these reasons, blindly using functions listed in <i>proto.h</i> is to be avoided when writing extensions.</p>

<p>In Perl, unlike C, a string of characters may generally contain embedded <code>NUL</code> characters. Sometimes in the documentation a Perl string is referred to as a &quot;buffer&quot; to distinguish it from a C string, but sometimes they are both just referred to as strings.</p>

<p>Note that all Perl API global variables must be referenced with the <code>PL_</code> prefix. Again, those not listed here are not to be used by extension writers, and can be changed or removed without notice; same with macros. Some macros are provided for compatibility with the older, unadorned names, but this support may be disabled in a future release.</p>

<p>Perl was originally written to handle US-ASCII only (that is characters whose ordinal numbers are in the range 0 - 127). And documentation and comments may still use the term ASCII, when sometimes in fact the entire range from 0 - 255 is meant.</p>

<p>The non-ASCII characters below 256 can have various meanings, depending on various things. (See, most notably, <a href="perllocale.html">perllocale</a>.) But usually the whole range can be referred to as ISO-8859-1. Often, the term &quot;Latin-1&quot; (or &quot;Latin1&quot;) is used as an equivalent for ISO-8859-1. But some people treat &quot;Latin1&quot; as referring just to the characters in the range 128 through 255, or sometimes from 160 through 255. This documentation uses &quot;Latin1&quot; and &quot;Latin-1&quot; to refer to all 256 characters.</p>

<p>Note that Perl can be compiled and run under either ASCII or EBCDIC (See <a href="perlebcdic.html">perlebcdic</a>). Most of the documentation (and even comments in the code) ignore the EBCDIC possibility. For almost all purposes the differences are transparent. As an example, under EBCDIC, instead of UTF-8, UTF-EBCDIC is used to encode Unicode strings, and so whenever this documentation refers to <code>utf8</code> (and variants of that name, including in function names), it also (essentially transparently) means <code>UTF-EBCDIC</code>. But the ordinals of characters differ between ASCII, EBCDIC, and the UTF- encodings, and a string encoded in UTF-EBCDIC may occupy a different number of bytes than in UTF-8.</p>

<p>The organization of this document is tentative and subject to change. Suggestions and patches welcome <a href="mailto:perl5-porters@perl.org">perl5-porters@perl.org</a>.</p>

<p>The sections in this document currently are</p>

<dl>

<dt id="&quot;AV-Handling&quot;"><a class="permalink" href="perlapi.html#%22AV-Handling%22">#</a><a id="AV-Handling1"></a><a href="perlapi.html#AV-Handling">&quot;AV Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Callback-Functions&quot;"><a class="permalink" href="perlapi.html#%22Callback-Functions%22">#</a><a id="Callback-Functions1"></a><a href="perlapi.html#Callback-Functions">&quot;Callback Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Casting&quot;"><a class="permalink" href="perlapi.html#%22Casting%22">#</a><a id="Casting1"></a><a href="perlapi.html#Casting">&quot;Casting&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Character-case-changing&quot;"><a class="permalink" href="perlapi.html#%22Character-case-changing%22">#</a><a id="Character-case-changing1"></a><a href="perlapi.html#Character-case-changing">&quot;Character case changing&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Character-classification&quot;"><a class="permalink" href="perlapi.html#%22Character-classification%22">#</a><a id="Character-classification1"></a><a href="perlapi.html#Character-classification">&quot;Character classification&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Compiler-and-Preprocessor-information&quot;"><a class="permalink" href="perlapi.html#%22Compiler-and-Preprocessor-information%22">#</a><a id="Compiler-and-Preprocessor-information1"></a><a href="perlapi.html#Compiler-and-Preprocessor-information">&quot;Compiler and Preprocessor information&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Compiler-directives&quot;"><a class="permalink" href="perlapi.html#%22Compiler-directives%22">#</a><a id="Compiler-directives1"></a><a href="perlapi.html#Compiler-directives">&quot;Compiler directives&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Compile-time-scope-hooks&quot;"><a class="permalink" href="perlapi.html#%22Compile-time-scope-hooks%22">#</a><a id="Compile-time-scope-hooks1"></a><a href="perlapi.html#Compile-time-scope-hooks">&quot;Compile-time scope hooks&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Concurrency&quot;"><a class="permalink" href="perlapi.html#%22Concurrency%22">#</a><a id="Concurrency1"></a><a href="perlapi.html#Concurrency">&quot;Concurrency&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;COP-Hint-Hashes&quot;"><a class="permalink" href="perlapi.html#%22COP-Hint-Hashes%22">#</a><a id="COP-Hint-Hashes1"></a><a href="perlapi.html#COP-Hint-Hashes">&quot;COP Hint Hashes&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Custom-Operators&quot;"><a class="permalink" href="perlapi.html#%22Custom-Operators%22">#</a><a id="Custom-Operators1"></a><a href="perlapi.html#Custom-Operators">&quot;Custom Operators&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;CV-Handling&quot;"><a class="permalink" href="perlapi.html#%22CV-Handling%22">#</a><a id="CV-Handling1"></a><a href="perlapi.html#CV-Handling">&quot;CV Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Debugging&quot;"><a class="permalink" href="perlapi.html#%22Debugging%22">#</a><a id="Debugging1"></a><a href="perlapi.html#Debugging">&quot;Debugging&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Display-functions&quot;"><a class="permalink" href="perlapi.html#%22Display-functions%22">#</a><a id="Display-functions1"></a><a href="perlapi.html#Display-functions">&quot;Display functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Embedding-and-Interpreter-Cloning&quot;"><a class="permalink" href="perlapi.html#%22Embedding-and-Interpreter-Cloning%22">#</a><a id="Embedding-and-Interpreter-Cloning1"></a><a href="perlapi.html#Embedding-and-Interpreter-Cloning">&quot;Embedding and Interpreter Cloning&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Errno&quot;"><a class="permalink" href="perlapi.html#%22Errno%22">#</a><a id="Errno1"></a><a href="perlapi.html#Errno">&quot;Errno&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Exception-Handling-(simple)-Macros&quot;"><a class="permalink" href="perlapi.html#%22Exception-Handling-(simple)-Macros%22">#</a><a id="Exception-Handling-simple-Macros"></a><a href="perlapi.html#Exception-Handling-%28simple%29-Macros">&quot;Exception Handling (simple) Macros&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Filesystem-configuration-values&quot;"><a class="permalink" href="perlapi.html#%22Filesystem-configuration-values%22">#</a><a id="Filesystem-configuration-values1"></a><a href="perlapi.html#Filesystem-configuration-values">&quot;Filesystem configuration values&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Floating-point-configuration-values&quot;"><a class="permalink" href="perlapi.html#%22Floating-point-configuration-values%22">#</a><a id="Floating-point-configuration-values1"></a><a href="perlapi.html#Floating-point-configuration-values">&quot;Floating point configuration values&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Formats&quot;"><a class="permalink" href="perlapi.html#%22Formats%22">#</a><a id="Formats1"></a><a href="perlapi.html#Formats">&quot;Formats&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;General-Configuration&quot;"><a class="permalink" href="perlapi.html#%22General-Configuration%22">#</a><a id="General-Configuration1"></a><a href="perlapi.html#General-Configuration">&quot;General Configuration&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Global-Variables&quot;"><a class="permalink" href="perlapi.html#%22Global-Variables%22">#</a><a id="Global-Variables1"></a><a href="perlapi.html#Global-Variables">&quot;Global Variables&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;GV-Handling&quot;"><a class="permalink" href="perlapi.html#%22GV-Handling%22">#</a><a id="GV-Handling1"></a><a href="perlapi.html#GV-Handling">&quot;GV Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Hook-manipulation&quot;"><a class="permalink" href="perlapi.html#%22Hook-manipulation%22">#</a><a id="Hook-manipulation1"></a><a href="perlapi.html#Hook-manipulation">&quot;Hook manipulation&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;HV-Handling&quot;"><a class="permalink" href="perlapi.html#%22HV-Handling%22">#</a><a id="HV-Handling1"></a><a href="perlapi.html#HV-Handling">&quot;HV Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Input/Output&quot;"><a class="permalink" href="perlapi.html#%22Input/Output%22">#</a><a id="Input-Output"></a><a href="perlapi.html#Input%2FOutput">&quot;Input/Output&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Integer-configuration-values&quot;"><a class="permalink" href="perlapi.html#%22Integer-configuration-values%22">#</a><a id="Integer-configuration-values1"></a><a href="perlapi.html#Integer-configuration-values">&quot;Integer configuration values&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Lexer-interface&quot;"><a class="permalink" href="perlapi.html#%22Lexer-interface%22">#</a><a id="Lexer-interface1"></a><a href="perlapi.html#Lexer-interface">&quot;Lexer interface&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Locales&quot;"><a class="permalink" href="perlapi.html#%22Locales%22">#</a><a id="Locales1"></a><a href="perlapi.html#Locales">&quot;Locales&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Magic&quot;"><a class="permalink" href="perlapi.html#%22Magic%22">#</a><a id="Magic1"></a><a href="perlapi.html#Magic">&quot;Magic&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Memory-Management&quot;"><a class="permalink" href="perlapi.html#%22Memory-Management%22">#</a><a id="Memory-Management1"></a><a href="perlapi.html#Memory-Management">&quot;Memory Management&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;MRO&quot;"><a class="permalink" href="perlapi.html#%22MRO%22">#</a><a id="MRO1"></a><a href="perlapi.html#MRO">&quot;MRO&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Multicall-Functions&quot;"><a class="permalink" href="perlapi.html#%22Multicall-Functions%22">#</a><a id="Multicall-Functions1"></a><a href="perlapi.html#Multicall-Functions">&quot;Multicall Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Numeric-Functions&quot;"><a class="permalink" href="perlapi.html#%22Numeric-Functions%22">#</a><a id="Numeric-Functions1"></a><a href="perlapi.html#Numeric-Functions">&quot;Numeric Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Optree-construction&quot;"><a class="permalink" href="perlapi.html#%22Optree-construction%22">#</a><a id="Optree-construction1"></a><a href="perlapi.html#Optree-construction">&quot;Optree construction&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Optree-Manipulation-Functions&quot;"><a class="permalink" href="perlapi.html#%22Optree-Manipulation-Functions%22">#</a><a id="Optree-Manipulation-Functions1"></a><a href="perlapi.html#Optree-Manipulation-Functions">&quot;Optree Manipulation Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Pack-and-Unpack&quot;"><a class="permalink" href="perlapi.html#%22Pack-and-Unpack%22">#</a><a id="Pack-and-Unpack1"></a><a href="perlapi.html#Pack-and-Unpack">&quot;Pack and Unpack&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Pad-Data-Structures&quot;"><a class="permalink" href="perlapi.html#%22Pad-Data-Structures%22">#</a><a id="Pad-Data-Structures1"></a><a href="perlapi.html#Pad-Data-Structures">&quot;Pad Data Structures&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Password-and-Group-access&quot;"><a class="permalink" href="perlapi.html#%22Password-and-Group-access%22">#</a><a id="Password-and-Group-access1"></a><a href="perlapi.html#Password-and-Group-access">&quot;Password and Group access&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Paths-to-system-commands&quot;"><a class="permalink" href="perlapi.html#%22Paths-to-system-commands%22">#</a><a id="Paths-to-system-commands1"></a><a href="perlapi.html#Paths-to-system-commands">&quot;Paths to system commands&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Prototype-information&quot;"><a class="permalink" href="perlapi.html#%22Prototype-information%22">#</a><a id="Prototype-information1"></a><a href="perlapi.html#Prototype-information">&quot;Prototype information&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;REGEXP-Functions&quot;"><a class="permalink" href="perlapi.html#%22REGEXP-Functions%22">#</a><a id="REGEXP-Functions1"></a><a href="perlapi.html#REGEXP-Functions">&quot;REGEXP Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Signals&quot;"><a class="permalink" href="perlapi.html#%22Signals%22">#</a><a id="Signals1"></a><a href="perlapi.html#Signals">&quot;Signals&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Site-configuration&quot;"><a class="permalink" href="perlapi.html#%22Site-configuration%22">#</a><a id="Site-configuration1"></a><a href="perlapi.html#Site-configuration">&quot;Site configuration&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Sockets-configuration-values&quot;"><a class="permalink" href="perlapi.html#%22Sockets-configuration-values%22">#</a><a id="Sockets-configuration-values1"></a><a href="perlapi.html#Sockets-configuration-values">&quot;Sockets configuration values&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Source-Filters&quot;"><a class="permalink" href="perlapi.html#%22Source-Filters%22">#</a><a id="Source-Filters1"></a><a href="perlapi.html#Source-Filters">&quot;Source Filters&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Stack-Manipulation-Macros&quot;"><a class="permalink" href="perlapi.html#%22Stack-Manipulation-Macros%22">#</a><a id="Stack-Manipulation-Macros1"></a><a href="perlapi.html#Stack-Manipulation-Macros">&quot;Stack Manipulation Macros&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;String-Handling&quot;"><a class="permalink" href="perlapi.html#%22String-Handling%22">#</a><a id="String-Handling1"></a><a href="perlapi.html#String-Handling">&quot;String Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;SV-Flags&quot;"><a class="permalink" href="perlapi.html#%22SV-Flags%22">#</a><a id="SV-Flags1"></a><a href="perlapi.html#SV-Flags">&quot;SV Flags&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;SV-Handling&quot;"><a class="permalink" href="perlapi.html#%22SV-Handling%22">#</a><a id="SV-Handling1"></a><a href="perlapi.html#SV-Handling">&quot;SV Handling&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Time&quot;"><a class="permalink" href="perlapi.html#%22Time%22">#</a><a id="Time1"></a><a href="perlapi.html#Time">&quot;Time&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Typedef-names&quot;"><a class="permalink" href="perlapi.html#%22Typedef-names%22">#</a><a id="Typedef-names1"></a><a href="perlapi.html#Typedef-names">&quot;Typedef names&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Unicode-Support&quot;"><a class="permalink" href="perlapi.html#%22Unicode-Support%22">#</a><a id="Unicode-Support1"></a><a href="perlapi.html#Unicode-Support">&quot;Unicode Support&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Utility-Functions&quot;"><a class="permalink" href="perlapi.html#%22Utility-Functions%22">#</a><a id="Utility-Functions1"></a><a href="perlapi.html#Utility-Functions">&quot;Utility Functions&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Versioning&quot;"><a class="permalink" href="perlapi.html#%22Versioning%22">#</a><a id="Versioning1"></a><a href="perlapi.html#Versioning">&quot;Versioning&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Warning-and-Dieing&quot;"><a class="permalink" href="perlapi.html#%22Warning-and-Dieing%22">#</a><a id="Warning-and-Dieing1"></a><a href="perlapi.html#Warning-and-Dieing">&quot;Warning and Dieing&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;XS&quot;"><a class="permalink" href="perlapi.html#%22XS%22">#</a><a id="XS2"></a><a href="perlapi.html#XS">&quot;XS&quot;</a></dt>
<dd>

</dd>
<dt id="&quot;Undocumented-elements&quot;"><a class="permalink" href="perlapi.html#%22Undocumented-elements%22">#</a><a id="Undocumented-elements1"></a><a href="perlapi.html#Undocumented-elements">&quot;Undocumented elements&quot;</a></dt>
<dd>

</dd>
</dl>

<p>The listing below is alphabetical, case insensitive.</p>

<h1 id="AV-Handling"><a class="permalink" href="perlapi.html#AV-Handling">#</a><a id="AV1"></a>AV Handling</h1>

<dl>

<dt id="AV"><a class="permalink" href="perlapi.html#AV">#</a><code>AV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="AvARRAY"><a class="permalink" href="perlapi.html#AvARRAY">#</a><code>AvARRAY</code> </dt>
<dd>

<p>Returns a pointer to the AV&#39;s internal SV* array.</p>

<p>This is useful for doing pointer arithmetic on the array. If all you need is to look up an array element, then prefer <code>av_fetch</code>.</p>

<ul>

<pre><code class="plaintext">SV**  AvARRAY(AV* av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_clear"><a class="permalink" href="perlapi.html#av_clear">#</a><code>av_clear</code> </dt>
<dd>

<p>Frees all the elements of an array, leaving it empty. The XS equivalent of <code>@array = ()</code>. See also <a href="perlapi.html#av_undef">&quot;av_undef&quot;</a>.</p>

<p>Note that it is possible that the actions of a destructor called directly or indirectly by freeing an element of the array could cause the reference count of the array itself to be reduced (e.g. by deleting an entry in the symbol table). So it is a possibility that the AV could have been freed (or even reallocated) on return from the call unless you hold a reference to it.</p>

<ul>

<pre><code class="plaintext">void  av_clear(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_count"><a class="permalink" href="perlapi.html#av_count">#</a><code>av_count</code> </dt>
<dd>

<p>Returns the number of elements in the array <code>av</code>. This is the true length of the array, including any undefined elements. It is always the same as <span style="white-space: nowrap;"><code>av_top_index(av) + 1</code></span>.</p>

<ul>

<pre><code class="plaintext">Size_t  av_count(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_create_and_push"><a class="permalink" href="perlapi.html#av_create_and_push">#</a><code>av_create_and_push</code> </dt>
<dd>

<p>NOTE: <code>av_create_and_push</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Push an SV onto the end of the array, creating the array if necessary. A small internal helper function to remove a commonly duplicated idiom.</p>

<p>NOTE: <code>av_create_and_push</code> must be explicitly called as <code>Perl_av_create_and_push</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_av_create_and_push(pTHX_ AV **const avp,
                              SV *const val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_create_and_unshift_one"><a class="permalink" href="perlapi.html#av_create_and_unshift_one">#</a><code>av_create_and_unshift_one</code> </dt>
<dd>

<p>NOTE: <code>av_create_and_unshift_one</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Unshifts an SV onto the beginning of the array, creating the array if necessary. A small internal helper function to remove a commonly duplicated idiom.</p>

<p>NOTE: <code>av_create_and_unshift_one</code> must be explicitly called as <code>Perl_av_create_and_unshift_one</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">SV**  Perl_av_create_and_unshift_one(pTHX_ AV **const avp,
                                     SV *const val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_delete"><a class="permalink" href="perlapi.html#av_delete">#</a><code>av_delete</code> </dt>
<dd>

<p>Deletes the element indexed by <code>key</code> from the array, makes the element mortal, and returns it. If <code>flags</code> equals <code>G_DISCARD</code>, the element is freed and NULL is returned. NULL is also returned if <code>key</code> is out of range.</p>

<p>Perl equivalent: <span style="white-space: nowrap;"><code>splice(@myarray, $key, 1, undef)</code></span> (with the <code>splice</code> in void context if <code>G_DISCARD</code> is present).</p>

<ul>

<pre><code class="plaintext">SV*  av_delete(AV *av, SSize_t key, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_exists"><a class="permalink" href="perlapi.html#av_exists">#</a><code>av_exists</code> </dt>
<dd>

<p>Returns true if the element indexed by <code>key</code> has been initialized.</p>

<p>This relies on the fact that uninitialized array elements are set to <code>NULL</code>.</p>

<p>Perl equivalent: <code>exists($myarray[$key])</code>.</p>

<ul>

<pre><code class="plaintext">bool  av_exists(AV *av, SSize_t key)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_extend"><a class="permalink" href="perlapi.html#av_extend">#</a><code>av_extend</code> </dt>
<dd>

<p>Pre-extend an array so that it is capable of storing values at indexes <code>0..key</code>. Thus <code>av_extend(av,99)</code> guarantees that the array can store 100 elements, i.e. that <code>av_store(av, 0, sv)</code> through <code>av_store(av, 99, sv)</code> on a plain array will work without any further memory allocation.</p>

<p>If the av argument is a tied array then will call the <code>EXTEND</code> tied array method with an argument of <code>(key+1)</code>.</p>

<ul>

<pre><code class="plaintext">void  av_extend(AV *av, SSize_t key)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_fetch"><a class="permalink" href="perlapi.html#av_fetch">#</a><code>av_fetch</code> </dt>
<dd>

<p>Returns the SV at the specified index in the array. The <code>key</code> is the index. If lval is true, you are guaranteed to get a real SV back (in case it wasn&#39;t real before), which you can then modify. Check that the return value is non-null before dereferencing it to a <code>SV*</code>.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied arrays.</p>

<p>The rough perl equivalent is <code>$myarray[$key]</code>.</p>

<ul>

<pre><code class="plaintext">SV**  av_fetch(AV *av, SSize_t key, I32 lval)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="AvFILL"><a class="permalink" href="perlapi.html#AvFILL">#</a><code>AvFILL</code> </dt>
<dd>

<p>Same as <code><a href="perlapi.html#av_top_index">&quot;av_top_index&quot;</a></code> or <code><a href="perlapi.html#av_tindex">&quot;av_tindex&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SSize_t  AvFILL(AV* av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_fill"><a class="permalink" href="perlapi.html#av_fill">#</a><code>av_fill</code> </dt>
<dd>

<p>Set the highest index in the array to the given number, equivalent to Perl&#39;s <span style="white-space: nowrap;"><code>$#array = $fill;</code></span>.</p>

<p>The number of elements in the array will be <span style="white-space: nowrap;"><code>fill + 1</code></span> after <code>av_fill()</code> returns. If the array was previously shorter, then the additional elements appended are set to NULL. If the array was longer, then the excess elements are freed. <span style="white-space: nowrap;"><code>av_fill(av, -1)</code></span> is the same as <code>av_clear(av)</code>.</p>

<ul>

<pre><code class="plaintext">void  av_fill(AV *av, SSize_t fill)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_len"><a class="permalink" href="perlapi.html#av_len">#</a><code>av_len</code> </dt>
<dd>

<p>Same as <a href="perlapi.html#av_top_index">&quot;av_top_index&quot;</a>. Note that, unlike what the name implies, it returns the maximum index in the array. This is unlike <a href="perlapi.html#sv_len">&quot;sv_len&quot;</a>, which returns what you would expect.</p>

<p><b>To get the true number of elements in the array, instead use <code><a href="perlapi.html#av_count">&quot;av_count&quot;</a></code></b>.</p>

<ul>

<pre><code class="plaintext">SSize_t  av_len(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_make"><a class="permalink" href="perlapi.html#av_make">#</a><code>av_make</code> </dt>
<dd>

<p>Creates a new AV and populates it with a list of SVs. The SVs are copied into the array, so they may be freed after the call to <code>av_make</code>. The new AV will have a reference count of 1.</p>

<p>Perl equivalent: <code>my @new_array = ($scalar1, $scalar2, $scalar3...);</code></p>

<ul>

<pre><code class="plaintext">AV*  av_make(SSize_t size, SV **strp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_pop"><a class="permalink" href="perlapi.html#av_pop">#</a><code>av_pop</code> </dt>
<dd>

<p>Removes one SV from the end of the array, reducing its size by one and returning the SV (transferring control of one reference count) to the caller. Returns <code>&amp;PL_sv_undef</code> if the array is empty.</p>

<p>Perl equivalent: <code>pop(@myarray);</code></p>

<ul>

<pre><code class="plaintext">SV*  av_pop(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_push"><a class="permalink" href="perlapi.html#av_push">#</a><code>av_push</code> </dt>
<dd>

<p>Pushes an SV (transferring control of one reference count) onto the end of the array. The array will grow automatically to accommodate the addition.</p>

<p>Perl equivalent: <code>push @myarray, $val;</code>.</p>

<ul>

<pre><code class="plaintext">void  av_push(AV *av, SV *val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_shift"><a class="permalink" href="perlapi.html#av_shift">#</a><code>av_shift</code> </dt>
<dd>

<p>Removes one SV from the start of the array, reducing its size by one and returning the SV (transferring control of one reference count) to the caller. Returns <code>&amp;PL_sv_undef</code> if the array is empty.</p>

<p>Perl equivalent: <code>shift(@myarray);</code></p>

<ul>

<pre><code class="plaintext">SV*  av_shift(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_store"><a class="permalink" href="perlapi.html#av_store">#</a><code>av_store</code> </dt>
<dd>

<p>Stores an SV in an array. The array index is specified as <code>key</code>. The return value will be <code>NULL</code> if the operation failed or if the value did not need to be actually stored within the array (as in the case of tied arrays). Otherwise, it can be dereferenced to get the <code>SV*</code> that was stored there (= <code>val</code>)).</p>

<p>Note that the caller is responsible for suitably incrementing the reference count of <code>val</code> before the call, and decrementing it if the function returned <code>NULL</code>.</p>

<p>Approximate Perl equivalent: <code>splice(@myarray, $key, 1, $val)</code>.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied arrays.</p>

<ul>

<pre><code class="plaintext">SV**  av_store(AV *av, SSize_t key, SV *val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_tindex"><a class="permalink" href="perlapi.html#av_tindex">#</a><code>av_tindex</code></dt>
<dd>

</dd>
<dt id="av_top_index"><a class="permalink" href="perlapi.html#av_top_index">#</a><code>av_top_index</code> </dt>
<dd>

<p>These behave identically. If the array <code>av</code> is empty, these return -1; otherwise they return the maximum value of the indices of all the array elements which are currently defined in <code>av</code>.</p>

<p>They process &#39;get&#39; magic.</p>

<p>The Perl equivalent for these is <code>$#av</code>.</p>

<p>Use <code><a href="perlapi.html#av_count">&quot;av_count&quot;</a></code> to get the number of elements in an array.</p>

<ul>

<pre><code class="plaintext">SSize_t  av_tindex(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_undef"><a class="permalink" href="perlapi.html#av_undef">#</a><code>av_undef</code> </dt>
<dd>

<p>Undefines the array. The XS equivalent of <code>undef(@array)</code>.</p>

<p>As well as freeing all the elements of the array (like <code>av_clear()</code>), this also frees the memory used by the av to store its list of scalars.</p>

<p>See <a href="perlapi.html#av_clear">&quot;av_clear&quot;</a> for a note about the array possibly being invalid on return.</p>

<ul>

<pre><code class="plaintext">void  av_undef(AV *av)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="av_unshift"><a class="permalink" href="perlapi.html#av_unshift">#</a><code>av_unshift</code> </dt>
<dd>

<p>Unshift the given number of <code>undef</code> values onto the beginning of the array. The array will grow automatically to accommodate the addition.</p>

<p>Perl equivalent: <span style="white-space: nowrap;"><code>unshift @myarray, ((undef) x $num);</code></span></p>

<ul>

<pre><code class="plaintext">void  av_unshift(AV *av, SSize_t num)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="get_av"><a class="permalink" href="perlapi.html#get_av">#</a><code>get_av</code> </dt>
<dd>

<p>Returns the AV of the specified Perl global or package array with the given name (so it won&#39;t work on lexical variables). <code>flags</code> are passed to <code>gv_fetchpv</code>. If <code>GV_ADD</code> is set and the Perl variable does not exist then it will be created. If <code>flags</code> is zero and the variable does not exist then NULL is returned.</p>

<p>Perl equivalent: <code>@{&quot;$name&quot;}</code>.</p>

<p>NOTE: the <code>perl_get_av()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">AV*  get_av(const char *name, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newAV"><a class="permalink" href="perlapi.html#newAV">#</a><code>newAV</code> </dt>
<dd>

<p>Creates a new AV. The reference count is set to 1.</p>

<p>Perl equivalent: <code>my @array;</code>.</p>

<ul>

<pre><code class="plaintext">AV*  newAV()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Nullav"><a class="permalink" href="perlapi.html#Nullav">#</a><code>Nullav</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>Nullav</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Null AV pointer.</p>

<p>(deprecated - use <code>(AV *)NULL</code> instead)</p>

</dd>
</dl>

<h1 id="Callback-Functions"><a class="permalink" href="perlapi.html#Callback-Functions">#</a><a id="Callback"></a>Callback Functions</h1>

<dl>

<dt id="call_argv"><a class="permalink" href="perlapi.html#call_argv">#</a><code>call_argv</code> </dt>
<dd>

<p>Performs a callback to the specified named and package-scoped Perl subroutine with <code>argv</code> (a <code>NULL</code>-terminated array of strings) as arguments. See <a href="perlcall.html">perlcall</a>.</p>

<p>Approximate Perl equivalent: <code>&amp;{&quot;$sub_name&quot;}(@$argv)</code>.</p>

<p>NOTE: the <code>perl_call_argv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">I32  call_argv(const char* sub_name, I32 flags, char** argv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="call_method"><a class="permalink" href="perlapi.html#call_method">#</a><code>call_method</code> </dt>
<dd>

<p>Performs a callback to the specified Perl method. The blessed object must be on the stack. See <a href="perlcall.html">perlcall</a>.</p>

<p>NOTE: the <code>perl_call_method()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">I32  call_method(const char* methname, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="call_pv"><a class="permalink" href="perlapi.html#call_pv">#</a><code>call_pv</code> </dt>
<dd>

<p>Performs a callback to the specified Perl sub. See <a href="perlcall.html">perlcall</a>.</p>

<p>NOTE: the <code>perl_call_pv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">I32  call_pv(const char* sub_name, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="call_sv"><a class="permalink" href="perlapi.html#call_sv">#</a><code>call_sv</code> </dt>
<dd>

<p>Performs a callback to the Perl sub specified by the SV.</p>

<p>If neither the <code>G_METHOD</code> nor <code>G_METHOD_NAMED</code> flag is supplied, the SV may be any of a CV, a GV, a reference to a CV, a reference to a GV or <code>SvPV(sv)</code> will be used as the name of the sub to call.</p>

<p>If the <code>G_METHOD</code> flag is supplied, the SV may be a reference to a CV or <code>SvPV(sv)</code> will be used as the name of the method to call.</p>

<p>If the <code>G_METHOD_NAMED</code> flag is supplied, <code>SvPV(sv)</code> will be used as the name of the method to call.</p>

<p>Some other values are treated specially for internal use and should not be depended on.</p>

<p>See <a href="perlcall.html">perlcall</a>.</p>

<p>NOTE: the <code>perl_call_sv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">I32  call_sv(SV* sv, volatile I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ENTER"><a class="permalink" href="perlapi.html#ENTER">#</a><code>ENTER</code> </dt>
<dd>

<p>Opening bracket on a callback. See <code><a href="perlapi.html#LEAVE">&quot;LEAVE&quot;</a></code> and <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code>ENTER;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ENTER_with_name"><a class="permalink" href="perlapi.html#ENTER_with_name">#</a><code>ENTER_with_name</code> </dt>
<dd>

<p>Same as <code><a href="perlapi.html#ENTER">&quot;ENTER&quot;</a></code>, but when debugging is enabled it also associates the given literal string with the new scope.</p>

<ul>

<pre><code>ENTER_with_name(&quot;name&quot;);</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="eval_pv"><a class="permalink" href="perlapi.html#eval_pv">#</a><code>eval_pv</code> </dt>
<dd>

<p>Tells Perl to <code>eval</code> the given string in scalar context and return an SV* result.</p>

<p>NOTE: the <code>perl_eval_pv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">SV*  eval_pv(const char* p, I32 croak_on_error)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="eval_sv"><a class="permalink" href="perlapi.html#eval_sv">#</a><code>eval_sv</code> </dt>
<dd>

<p>Tells Perl to <code>eval</code> the string in the SV. It supports the same flags as <code>call_sv</code>, with the obvious exception of <code>G_EVAL</code>. See <a href="perlcall.html">perlcall</a>.</p>

<p>The <code>G_RETHROW</code> flag can be used if you only need eval_sv() to execute code specified by a string, but not catch any errors.</p>

<p>NOTE: the <code>perl_eval_sv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">I32  eval_sv(SV* sv, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="FREETMPS"><a class="permalink" href="perlapi.html#FREETMPS">#</a><code>FREETMPS</code> </dt>
<dd>

<p>Closing bracket for temporaries on a callback. See <code><a href="perlapi.html#SAVETMPS">&quot;SAVETMPS&quot;</a></code> and <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code>FREETMPS;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="G_ARRAY"><a class="permalink" href="perlapi.html#G_ARRAY">#</a><code>G_ARRAY</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="G_DISCARD"><a class="permalink" href="perlapi.html#G_DISCARD">#</a><code>G_DISCARD</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="G_EVAL"><a class="permalink" href="perlapi.html#G_EVAL">#</a><code>G_EVAL</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="GIMME"><a class="permalink" href="perlapi.html#GIMME">#</a><code>GIMME</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>GIMME</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>A backward-compatible version of <code>GIMME_V</code> which can only return <code>G_SCALAR</code> or <code>G_ARRAY</code>; in a void context, it returns <code>G_SCALAR</code>. Deprecated. Use <code>GIMME_V</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  GIMME</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GIMME_V"><a class="permalink" href="perlapi.html#GIMME_V">#</a><code>GIMME_V</code> </dt>
<dd>

<p>The XSUB-writer&#39;s equivalent to Perl&#39;s <code>wantarray</code>. Returns <code>G_VOID</code>, <code>G_SCALAR</code> or <code>G_ARRAY</code> for void, scalar or list context, respectively. See <a href="perlcall.html">perlcall</a> for a usage example.</p>

<ul>

<pre><code class="plaintext">U32  GIMME_V</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="G_KEEPERR"><a class="permalink" href="perlapi.html#G_KEEPERR">#</a><code>G_KEEPERR</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="G_NOARGS"><a class="permalink" href="perlapi.html#G_NOARGS">#</a><code>G_NOARGS</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="G_SCALAR"><a class="permalink" href="perlapi.html#G_SCALAR">#</a><code>G_SCALAR</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="G_VOID"><a class="permalink" href="perlapi.html#G_VOID">#</a><code>G_VOID</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="LEAVE"><a class="permalink" href="perlapi.html#LEAVE">#</a><code>LEAVE</code> </dt>
<dd>

<p>Closing bracket on a callback. See <code><a href="perlapi.html#ENTER">&quot;ENTER&quot;</a></code> and <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code>LEAVE;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LEAVE_with_name"><a class="permalink" href="perlapi.html#LEAVE_with_name">#</a><code>LEAVE_with_name</code> </dt>
<dd>

<p>Same as <code><a href="perlapi.html#LEAVE">&quot;LEAVE&quot;</a></code>, but when debugging is enabled it first checks that the scope has the given name. <code>name</code> must be a literal string.</p>

<ul>

<pre><code>LEAVE_with_name(&quot;name&quot;);</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_errgv"><a class="permalink" href="perlapi.html#PL_errgv">#</a><code>PL_errgv</code></dt>
<dd>

<p>Described in <a href="perlcall.html">perlcall</a>.</p>

</dd>
</dl>

<dl>

<dt id="SAVETMPS"><a class="permalink" href="perlapi.html#SAVETMPS">#</a><code>SAVETMPS</code> </dt>
<dd>

<p>Opening bracket for temporaries on a callback. See <code><a href="perlapi.html#FREETMPS">&quot;FREETMPS&quot;</a></code> and <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code>SAVETMPS;</code></pre>

</ul>

</dd>
</dl>

<h1 id="Casting"><a class="permalink" href="perlapi.html#Casting">#</a>Casting</h1>

<dl>

<dt id="cBOOL"><a class="permalink" href="perlapi.html#cBOOL">#</a><code>cBOOL</code> </dt>
<dd>

<p>Cast-to-bool. A simple <span style="white-space: nowrap;"><code>(bool) <i>expr</i></code></span> cast may not do the right thing: if <code>bool</code> is defined as <code>char</code>, for example, then the cast from <code>int</code> is implementation-defined.</p>

<p><code>(bool)!!(cbool)</code> in a ternary triggers a bug in xlc on AIX</p>

<ul>

<pre><code class="plaintext">bool  cBOOL(bool expr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_32"><a class="permalink" href="perlapi.html#I_32">#</a><code>I_32</code> </dt>
<dd>

<p>Cast an NV to I32 while avoiding undefined C behavior</p>

<ul>

<pre><code class="plaintext">I32  I_32(NV what)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="INT2PTR"><a class="permalink" href="perlapi.html#INT2PTR">#</a><code>INT2PTR</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">type  INT2PTR(type, int value)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_V"><a class="permalink" href="perlapi.html#I_V">#</a><code>I_V</code> </dt>
<dd>

<p>Cast an NV to IV while avoiding undefined C behavior</p>

<ul>

<pre><code class="plaintext">IV  I_V(NV what)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_cpeep_t"><a class="permalink" href="perlapi.html#Perl_cpeep_t">#</a><code>Perl_cpeep_t</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="PTR2IV"><a class="permalink" href="perlapi.html#PTR2IV">#</a><code>PTR2IV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">IV  PTR2IV(void * ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PTR2nat"><a class="permalink" href="perlapi.html#PTR2nat">#</a><code>PTR2nat</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">IV  PTR2nat(void *)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PTR2NV"><a class="permalink" href="perlapi.html#PTR2NV">#</a><code>PTR2NV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">NV  PTR2NV(void * ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PTR2ul"><a class="permalink" href="perlapi.html#PTR2ul">#</a><code>PTR2ul</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">unsigned long  PTR2ul(void *)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PTR2UV"><a class="permalink" href="perlapi.html#PTR2UV">#</a><code>PTR2UV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">UV  PTR2UV(void * ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PTRV"><a class="permalink" href="perlapi.html#PTRV">#</a><code>PTRV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="U_32"><a class="permalink" href="perlapi.html#U_32">#</a><code>U_32</code> </dt>
<dd>

<p>Cast an NV to U32 while avoiding undefined C behavior</p>

<ul>

<pre><code class="plaintext">U32  U_32(NV what)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="U_V"><a class="permalink" href="perlapi.html#U_V">#</a><code>U_V</code> </dt>
<dd>

<p>Cast an NV to UV while avoiding undefined C behavior</p>

<ul>

<pre><code class="plaintext">UV  U_V(NV what)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XOP"><a class="permalink" href="perlapi.html#XOP">#</a><code>XOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<h1 id="Character-case-changing"><a class="permalink" href="perlapi.html#Character-case-changing">#</a><a id="Character"></a>Character case changing</h1>

<p>Perl uses &quot;full&quot; Unicode case mappings. This means that converting a single character to another case may result in a sequence of more than one character. For example, the uppercase of <code>ß</code> (LATIN SMALL LETTER SHARP S) is the two character sequence <code>SS</code>. This presents some complications The lowercase of all characters in the range 0..255 is a single character, and thus <code><a href="perlapi.html#toLOWER_L1">&quot;toLOWER_L1&quot;</a></code> is furnished. But, <code>toUPPER_L1</code> can&#39;t exist, as it couldn&#39;t return a valid result for all legal inputs. Instead <code><a href="perlapi.html#toUPPER_uvchr">&quot;toUPPER_uvchr&quot;</a></code> has an API that does allow every possible legal result to be returned.) Likewise no other function that is crippled by not being able to give the correct results for the full range of possible inputs has been implemented here.</p>

<dl>

<dt id="toFOLD"><a class="permalink" href="perlapi.html#toFOLD">#</a><code>toFOLD</code> </dt>
<dd>

<p>Converts the specified character to foldcase. If the input is anything but an ASCII uppercase character, that input character itself is returned. Variant <code>toFOLD_A</code> is equivalent. (There is no equivalent <code>to_FOLD_L1</code> for the full Latin1 range, as the full generality of <a href="perlapi.html#toFOLD_uvchr">&quot;toFOLD_uvchr&quot;</a> is needed there.)</p>

<ul>

<pre><code class="plaintext">U8  toFOLD(U8 ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toFOLD_utf8"><a class="permalink" href="perlapi.html#toFOLD_utf8">#</a><code>toFOLD_utf8</code></dt>
<dd>

</dd>
<dt id="toFOLD_utf8_safe"><a class="permalink" href="perlapi.html#toFOLD_utf8_safe">#</a><code>toFOLD_utf8_safe</code> </dt>
<dd>

<p>Converts the first UTF-8 encoded character in the sequence starting at <code>p</code> and extending no further than <span style="white-space: nowrap;"><code>e - 1</code></span> to its foldcase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the foldcase version may be longer than the original character.</p>

<p>The first code point of the foldcased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more).</p>

<p>It will not attempt to read beyond <span style="white-space: nowrap;"><code>e - 1</code></span>, provided that the constraint <span style="white-space: nowrap;"><code>s &lt; e</code></span> is true (this is asserted for in <code>-DDEBUGGING</code> builds). If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return the REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to change in future releases.</p>

<p><code>toFOLD_utf8_safe</code> is now just a different spelling of plain <code>toFOLD_utf8</code></p>

<ul>

<pre><code class="plaintext">UV  toFOLD_utf8(U8* p, U8* e, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toFOLD_uvchr"><a class="permalink" href="perlapi.html#toFOLD_uvchr">#</a><code>toFOLD_uvchr</code> </dt>
<dd>

<p>Converts the code point <code>cp</code> to its foldcase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. The code point is interpreted as native if less than 256; otherwise as Unicode. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the foldcase version may be longer than the original character.</p>

<p>The first code point of the foldcased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more).</p>

<ul>

<pre><code class="plaintext">UV  toFOLD_uvchr(UV cp, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toLOWER"><a class="permalink" href="perlapi.html#toLOWER">#</a><code>toLOWER</code></dt>
<dd>

</dd>
<dt id="toLOWER_A"><a class="permalink" href="perlapi.html#toLOWER_A">#</a><code>toLOWER_A</code></dt>
<dd>

</dd>
<dt id="toLOWER_L1"><a class="permalink" href="perlapi.html#toLOWER_L1">#</a><code>toLOWER_L1</code></dt>
<dd>

</dd>
<dt id="toLOWER_LATIN1"><a class="permalink" href="perlapi.html#toLOWER_LATIN1">#</a><code>toLOWER_LATIN1</code></dt>
<dd>

</dd>
<dt id="toLOWER_LC"><a class="permalink" href="perlapi.html#toLOWER_LC">#</a><code>toLOWER_LC</code></dt>
<dd>

</dd>
<dt id="toLOWER_uvchr"><a class="permalink" href="perlapi.html#toLOWER_uvchr">#</a><code>toLOWER_uvchr</code></dt>
<dd>

</dd>
<dt id="toLOWER_utf8"><a class="permalink" href="perlapi.html#toLOWER_utf8">#</a><code>toLOWER_utf8</code></dt>
<dd>

</dd>
<dt id="toLOWER_utf8_safe"><a class="permalink" href="perlapi.html#toLOWER_utf8_safe">#</a><code>toLOWER_utf8_safe</code> </dt>
<dd>

<p>These all return the lowercase of a character. The differences are what domain they operate on, and whether the input is specified as a code point (those forms with a <code>cp</code> parameter) or as a UTF-8 string (the others). In the latter case, the code point to use is the first one in the buffer of UTF-8 encoded code points, delineated by the arguments <span style="white-space: nowrap;"><code>p .. e - 1</code></span>.</p>

<p><code>toLOWER</code> and <code>toLOWER_A</code> are synonyms of each other. They return the lowercase of any uppercase ASCII-range code point. All other inputs are returned unchanged. Since these are macros, the input type may be any integral one, and the output will occupy the same number of bits as the input.</p>

<p><code>toLOWER_L1</code> and <code>toLOWER_LATIN1</code> are synonyms of each other. They behave identically as <code>toLOWER</code> for ASCII-range input. But additionally will return the lowercase of any uppercase code point in the entire 0..255 range, assuming a Latin-1 encoding (or the EBCDIC equivalent on such platforms).</p>

<p><code>toLOWER_LC</code> returns the lowercase of the input code point according to the rules of the current POSIX locale. Input code points outside the range 0..255 are returned unchanged.</p>

<p><code>toLOWER_uvchr</code> returns the lowercase of any Unicode code point. The return value is identical to that of <code>toLOWER_L1</code> for input code points in the 0..255 range. The lowercase of the vast majority of Unicode code points is the same as the code point itself. For these, and for code points above the legal Unicode maximum, this returns the input code point unchanged. It additionally stores the UTF-8 of the result into the buffer beginning at <code>s</code>, and its length in bytes into <code>*lenp</code>. The caller must have made <code>s</code> large enough to contain at least <code>UTF8_MAXBYTES_CASE+1</code> bytes to avoid possible overflow.</p>

<p>NOTE: the lowercase of a code point may be more than one code point. The return value of this function is only the first of these. The entire lowercase is returned in <code>s</code>. To determine if the result is more than a single code point, you can do something like this:</p>

<pre><code>uc = toLOWER_uvchr(cp, s, &amp;len);
if (len &gt; UTF8SKIP(s)) { is multiple code points }
else { is a single code point }</code></pre>

<p><code>toLOWER_utf8</code> and <code>toLOWER_utf8_safe</code> are synonyms of each other. The only difference between these and <code>toLOWER_uvchr</code> is that the source for these is encoded in UTF-8, instead of being a code point. It is passed as a buffer starting at <code>p</code>, with <code>e</code> pointing to one byte beyond its end. The <code>p</code> buffer may certainly contain more than one code point; but only the first one (up through <span style="white-space: nowrap;"><code>e - 1</code></span>) is examined. If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return the REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to change in future releases.</p>

<ul>

<pre><code class="plaintext">UV  toLOWER          (UV cp)
UV  toLOWER_A        (UV cp)
UV  toLOWER_L1       (UV cp)
UV  toLOWER_LATIN1   (UV cp)
UV  toLOWER_LC       (UV cp)
UV  toLOWER_uvchr    (UV cp, U8* s, STRLEN* lenp)
UV  toLOWER_utf8     (U8* p, U8* e, U8* s, STRLEN* lenp)
UV  toLOWER_utf8_safe(U8* p, U8* e, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toTITLE"><a class="permalink" href="perlapi.html#toTITLE">#</a><code>toTITLE</code> </dt>
<dd>

<p>Converts the specified character to titlecase. If the input is anything but an ASCII lowercase character, that input character itself is returned. Variant <code>toTITLE_A</code> is equivalent. (There is no <code>toTITLE_L1</code> for the full Latin1 range, as the full generality of <a href="perlapi.html#toTITLE_uvchr">&quot;toTITLE_uvchr&quot;</a> is needed there. Titlecase is not a concept used in locale handling, so there is no functionality for that.)</p>

<ul>

<pre><code class="plaintext">U8  toTITLE(U8 ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toTITLE_utf8"><a class="permalink" href="perlapi.html#toTITLE_utf8">#</a><code>toTITLE_utf8</code></dt>
<dd>

</dd>
<dt id="toTITLE_utf8_safe"><a class="permalink" href="perlapi.html#toTITLE_utf8_safe">#</a><code>toTITLE_utf8_safe</code> </dt>
<dd>

<p>Convert the first UTF-8 encoded character in the sequence starting at <code>p</code> and extending no further than <span style="white-space: nowrap;"><code>e - 1</code></span> to its titlecase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the titlecase version may be longer than the original character.</p>

<p>The first code point of the titlecased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more).</p>

<p>It will not attempt to read beyond <span style="white-space: nowrap;"><code>e - 1</code></span>, provided that the constraint <span style="white-space: nowrap;"><code>s &lt; e</code></span> is true (this is asserted for in <code>-DDEBUGGING</code> builds). If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return the REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to change in future releases.</p>

<p><code>toTITLE_utf8_safe</code> is now just a different spelling of plain <code>toTITLE_utf8</code></p>

<ul>

<pre><code class="plaintext">UV  toTITLE_utf8(U8* p, U8* e, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toTITLE_uvchr"><a class="permalink" href="perlapi.html#toTITLE_uvchr">#</a><code>toTITLE_uvchr</code> </dt>
<dd>

<p>Converts the code point <code>cp</code> to its titlecase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. The code point is interpreted as native if less than 256; otherwise as Unicode. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the titlecase version may be longer than the original character.</p>

<p>The first code point of the titlecased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more).</p>

<ul>

<pre><code class="plaintext">UV  toTITLE_uvchr(UV cp, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toUPPER"><a class="permalink" href="perlapi.html#toUPPER">#</a><code>toUPPER</code> </dt>
<dd>

<p>Converts the specified character to uppercase. If the input is anything but an ASCII lowercase character, that input character itself is returned. Variant <code>toUPPER_A</code> is equivalent.</p>

<ul>

<pre><code class="plaintext">U8  toUPPER(int ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toUPPER_utf8"><a class="permalink" href="perlapi.html#toUPPER_utf8">#</a><code>toUPPER_utf8</code></dt>
<dd>

</dd>
<dt id="toUPPER_utf8_safe"><a class="permalink" href="perlapi.html#toUPPER_utf8_safe">#</a><code>toUPPER_utf8_safe</code> </dt>
<dd>

<p>Converts the first UTF-8 encoded character in the sequence starting at <code>p</code> and extending no further than <span style="white-space: nowrap;"><code>e - 1</code></span> to its uppercase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the uppercase version may be longer than the original character.</p>

<p>The first code point of the uppercased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more).</p>

<p>It will not attempt to read beyond <span style="white-space: nowrap;"><code>e - 1</code></span>, provided that the constraint <span style="white-space: nowrap;"><code>s &lt; e</code></span> is true (this is asserted for in <code>-DDEBUGGING</code> builds). If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return the REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to change in future releases.</p>

<p><code>toUPPER_utf8_safe</code> is now just a different spelling of plain <code>toUPPER_utf8</code></p>

<ul>

<pre><code class="plaintext">UV  toUPPER_utf8(U8* p, U8* e, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="toUPPER_uvchr"><a class="permalink" href="perlapi.html#toUPPER_uvchr">#</a><code>toUPPER_uvchr</code> </dt>
<dd>

<p>Converts the code point <code>cp</code> to its uppercase version, and stores that in UTF-8 in <code>s</code>, and its length in bytes in <code>lenp</code>. The code point is interpreted as native if less than 256; otherwise as Unicode. Note that the buffer pointed to by <code>s</code> needs to be at least <code>UTF8_MAXBYTES_CASE+1</code> bytes since the uppercase version may be longer than the original character.</p>

<p>The first code point of the uppercased version is returned (but note, as explained at <a href="perlapi.html#Character-case-changing">the top of this section</a>, that there may be more.)</p>

<ul>

<pre><code class="plaintext">UV  toUPPER_uvchr(UV cp, U8* s, STRLEN* lenp)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Character-classification"><a class="permalink" href="perlapi.html#Character-classification">#</a><a id="Character1"></a>Character classification</h1>

<p>This section is about functions (really macros) that classify characters into types, such as punctuation versus alphabetic, etc. Most of these are analogous to regular expression character classes. (See <a href="perlrecharclass.html#POSIX-Character-Classes">&quot;POSIX Character Classes&quot; in perlrecharclass</a>.) There are several variants for each class. (Not all macros have all variants; each item below lists the ones valid for it.) None are affected by <code>use bytes</code>, and only the ones with <code>LC</code> in the name are affected by the current locale.</p>

<p>The base function, e.g., <code>isALPHA()</code>, takes any signed or unsigned value, treating it as a code point, and returns a boolean as to whether or not the character represented by it is (or on non-ASCII platforms, corresponds to) an ASCII character in the named class based on platform, Unicode, and Perl rules. If the input is a number that doesn&#39;t fit in an octet, FALSE is returned.</p>

<p>Variant <code>is<i>FOO</i>_A</code> (e.g., <code>isALPHA_A()</code>) is identical to the base function with no suffix <code>&quot;_A&quot;</code>. This variant is used to emphasize by its name that only ASCII-range characters can return TRUE.</p>

<p>Variant <code>is<i>FOO</i>_L1</code> imposes the Latin-1 (or EBCDIC equivalent) character set onto the platform. That is, the code points that are ASCII are unaffected, since ASCII is a subset of Latin-1. But the non-ASCII code points are treated as if they are Latin-1 characters. For example, <code>isWORDCHAR_L1()</code> will return true when called with the code point 0xDF, which is a word character in both ASCII and EBCDIC (though it represents different characters in each). If the input is a number that doesn&#39;t fit in an octet, FALSE is returned. (Perl&#39;s documentation uses a colloquial definition of Latin-1, to include all code points below 256.)</p>

<p>Variant <code>is<i>FOO</i>_uvchr</code> is exactly like the <code>is<i>FOO</i>_L1</code> variant, for inputs below 256, but if the code point is larger than 255, Unicode rules are used to determine if it is in the character class. For example, <code>isWORDCHAR_uvchr(0x100)</code> returns TRUE, since 0x100 is LATIN CAPITAL LETTER A WITH MACRON in Unicode, and is a word character.</p>

<p>Variants <code>is<i>FOO</i>_utf8</code> and <code>is<i>FOO</i>_utf8_safe</code> are like <code>is<i>FOO</i>_uvchr</code>, but are used for UTF-8 encoded strings. The two forms are different names for the same thing. Each call to one of these classifies the first character of the string starting at <code>p</code>. The second parameter, <code>e</code>, points to anywhere in the string beyond the first character, up to one byte past the end of the entire string. Although both variants are identical, the suffix <code>_safe</code> in one name emphasizes that it will not attempt to read beyond <span style="white-space: nowrap;"><code>e - 1</code></span>, provided that the constraint <span style="white-space: nowrap;"><code>s &lt; e</code></span> is true (this is asserted for in <code>-DDEBUGGING</code> builds). If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return FALSE, at the discretion of the implementation, and subject to change in future releases.</p>

<p>Variant <code>is<i>FOO</i>_LC</code> is like the <code>is<i>FOO</i>_A</code> and <code>is<i>FOO</i>_L1</code> variants, but the result is based on the current locale, which is what <code>LC</code> in the name stands for. If Perl can determine that the current locale is a UTF-8 locale, it uses the published Unicode rules; otherwise, it uses the C library function that gives the named classification. For example, <code>isDIGIT_LC()</code> when not in a UTF-8 locale returns the result of calling <code>isdigit()</code>. FALSE is always returned if the input won&#39;t fit into an octet. On some platforms where the C library function is known to be defective, Perl changes its result to follow the POSIX standard&#39;s rules.</p>

<p>Variant <code>is<i>FOO</i>_LC_uvchr</code> acts exactly like <code>is<i>FOO</i>_LC</code> for inputs less than 256, but for larger ones it returns the Unicode classification of the code point.</p>

<p>Variants <code>is<i>FOO</i>_LC_utf8</code> and <code>is<i>FOO</i>_LC_utf8_safe</code> are like <code>is<i>FOO</i>_LC_uvchr</code>, but are used for UTF-8 encoded strings. The two forms are different names for the same thing. Each call to one of these classifies the first character of the string starting at <code>p</code>. The second parameter, <code>e</code>, points to anywhere in the string beyond the first character, up to one byte past the end of the entire string. Although both variants are identical, the suffix <code>_safe</code> in one name emphasizes that it will not attempt to read beyond <span style="white-space: nowrap;"><code>e - 1</code></span>, provided that the constraint <span style="white-space: nowrap;"><code>s &lt; e</code></span> is true (this is asserted for in <code>-DDEBUGGING</code> builds). If the UTF-8 for the input character is malformed in some way, the program may croak, or the function may return FALSE, at the discretion of the implementation, and subject to change in future releases.</p>

<dl>

<dt id="isALPHA"><a class="permalink" href="perlapi.html#isALPHA">#</a><code>isALPHA</code></dt>
<dd>

</dd>
<dt id="isALPHA_A"><a class="permalink" href="perlapi.html#isALPHA_A">#</a><code>isALPHA_A</code></dt>
<dd>

</dd>
<dt id="isALPHA_L1"><a class="permalink" href="perlapi.html#isALPHA_L1">#</a><code>isALPHA_L1</code></dt>
<dd>

</dd>
<dt id="isALPHA_uvchr"><a class="permalink" href="perlapi.html#isALPHA_uvchr">#</a><code>isALPHA_uvchr</code></dt>
<dd>

</dd>
<dt id="isALPHA_utf8_safe"><a class="permalink" href="perlapi.html#isALPHA_utf8_safe">#</a><code>isALPHA_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isALPHA_utf8"><a class="permalink" href="perlapi.html#isALPHA_utf8">#</a><code>isALPHA_utf8</code></dt>
<dd>

</dd>
<dt id="isALPHA_LC"><a class="permalink" href="perlapi.html#isALPHA_LC">#</a><code>isALPHA_LC</code></dt>
<dd>

</dd>
<dt id="isALPHA_LC_uvchr"><a class="permalink" href="perlapi.html#isALPHA_LC_uvchr">#</a><code>isALPHA_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isALPHA_LC_utf8_safe"><a class="permalink" href="perlapi.html#isALPHA_LC_utf8_safe">#</a><code>isALPHA_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified input is one of <code>[A-Za-z]</code>, analogous to <code>m/[[:alpha:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isALPHA             (UV ch)
bool  isALPHA_A           (UV ch)
bool  isALPHA_L1          (UV ch)
bool  isALPHA_uvchr       (UV ch)
bool  isALPHA_utf8_safe   (U8 * s, U8 * end)
bool  isALPHA_utf8        (U8 * s, U8 * end)
bool  isALPHA_LC          (UV ch)
bool  isALPHA_LC_uvchr    (UV ch)
bool  isALPHA_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isALPHANUMERIC"><a class="permalink" href="perlapi.html#isALPHANUMERIC">#</a><code>isALPHANUMERIC</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_A"><a class="permalink" href="perlapi.html#isALPHANUMERIC_A">#</a><code>isALPHANUMERIC_A</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_L1"><a class="permalink" href="perlapi.html#isALPHANUMERIC_L1">#</a><code>isALPHANUMERIC_L1</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_uvchr"><a class="permalink" href="perlapi.html#isALPHANUMERIC_uvchr">#</a><code>isALPHANUMERIC_uvchr</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_utf8_safe"><a class="permalink" href="perlapi.html#isALPHANUMERIC_utf8_safe">#</a><code>isALPHANUMERIC_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_utf8"><a class="permalink" href="perlapi.html#isALPHANUMERIC_utf8">#</a><code>isALPHANUMERIC_utf8</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_LC"><a class="permalink" href="perlapi.html#isALPHANUMERIC_LC">#</a><code>isALPHANUMERIC_LC</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_LC_uvchr"><a class="permalink" href="perlapi.html#isALPHANUMERIC_LC_uvchr">#</a><code>isALPHANUMERIC_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isALPHANUMERIC_LC_utf8_safe"><a class="permalink" href="perlapi.html#isALPHANUMERIC_LC_utf8_safe">#</a><code>isALPHANUMERIC_LC_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isALNUMC"><a class="permalink" href="perlapi.html#isALNUMC">#</a><code>isALNUMC</code></dt>
<dd>

</dd>
<dt id="isALNUMC_A"><a class="permalink" href="perlapi.html#isALNUMC_A">#</a><code>isALNUMC_A</code></dt>
<dd>

</dd>
<dt id="isALNUMC_L1"><a class="permalink" href="perlapi.html#isALNUMC_L1">#</a><code>isALNUMC_L1</code></dt>
<dd>

</dd>
<dt id="isALNUMC_LC"><a class="permalink" href="perlapi.html#isALNUMC_LC">#</a><code>isALNUMC_LC</code></dt>
<dd>

</dd>
<dt id="isALNUMC_LC_uvchr"><a class="permalink" href="perlapi.html#isALNUMC_LC_uvchr">#</a><code>isALNUMC_LC_uvchr</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is one of <code>[A-Za-z0-9]</code>, analogous to <code>m/[[:alnum:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<p>A (discouraged from use) synonym is <code>isALNUMC</code> (where the <code>C</code> suffix means this corresponds to the C language alphanumeric definition). Also there are the variants <code>isALNUMC_A</code>, <code>isALNUMC_L1</code> <code>isALNUMC_LC</code>, and <code>isALNUMC_LC_uvchr</code>.</p>

<ul>

<pre><code class="plaintext">bool  isALPHANUMERIC             (UV ch)
bool  isALPHANUMERIC_A           (UV ch)
bool  isALPHANUMERIC_L1          (UV ch)
bool  isALPHANUMERIC_uvchr       (UV ch)
bool  isALPHANUMERIC_utf8_safe   (U8 * s, U8 * end)
bool  isALPHANUMERIC_utf8        (U8 * s, U8 * end)
bool  isALPHANUMERIC_LC          (UV ch)
bool  isALPHANUMERIC_LC_uvchr    (UV ch)
bool  isALPHANUMERIC_LC_utf8_safe(U8 * s, U8 *end)
bool  isALNUMC                   (UV ch)
bool  isALNUMC_A                 (UV ch)
bool  isALNUMC_L1                (UV ch)
bool  isALNUMC_LC                (UV ch)
bool  isALNUMC_LC_uvchr          (UV ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isASCII"><a class="permalink" href="perlapi.html#isASCII">#</a><code>isASCII</code></dt>
<dd>

</dd>
<dt id="isASCII_A"><a class="permalink" href="perlapi.html#isASCII_A">#</a><code>isASCII_A</code></dt>
<dd>

</dd>
<dt id="isASCII_L1"><a class="permalink" href="perlapi.html#isASCII_L1">#</a><code>isASCII_L1</code></dt>
<dd>

</dd>
<dt id="isASCII_uvchr"><a class="permalink" href="perlapi.html#isASCII_uvchr">#</a><code>isASCII_uvchr</code></dt>
<dd>

</dd>
<dt id="isASCII_utf8_safe"><a class="permalink" href="perlapi.html#isASCII_utf8_safe">#</a><code>isASCII_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isASCII_utf8"><a class="permalink" href="perlapi.html#isASCII_utf8">#</a><code>isASCII_utf8</code></dt>
<dd>

</dd>
<dt id="isASCII_LC"><a class="permalink" href="perlapi.html#isASCII_LC">#</a><code>isASCII_LC</code></dt>
<dd>

</dd>
<dt id="isASCII_LC_uvchr"><a class="permalink" href="perlapi.html#isASCII_LC_uvchr">#</a><code>isASCII_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isASCII_LC_utf8_safe"><a class="permalink" href="perlapi.html#isASCII_LC_utf8_safe">#</a><code>isASCII_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is one of the 128 characters in the ASCII character set, analogous to <code>m/[[:ascii:]]/</code>. On non-ASCII platforms, it returns TRUE iff this character corresponds to an ASCII character. Variants <code>isASCII_A()</code> and <code>isASCII_L1()</code> are identical to <code>isASCII()</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants. Note, however, that some platforms do not have the C library routine <code>isascii()</code>. In these cases, the variants whose names contain <code>LC</code> are the same as the corresponding ones without.</p>

<p>Also note, that because all ASCII characters are UTF-8 invariant (meaning they have the exact same representation (always a single byte) whether encoded in UTF-8 or not), <code>isASCII</code> will give the correct results when called with any byte in any string encoded or not in UTF-8. And similarly <code>isASCII_utf8</code> and <code>isASCII_utf8_safe</code> will work properly on any string encoded or not in UTF-8.</p>

<ul>

<pre><code class="plaintext">bool  isASCII             (UV ch)
bool  isASCII_A           (UV ch)
bool  isASCII_L1          (UV ch)
bool  isASCII_uvchr       (UV ch)
bool  isASCII_utf8_safe   (U8 * s, U8 * end)
bool  isASCII_utf8        (U8 * s, U8 * end)
bool  isASCII_LC          (UV ch)
bool  isASCII_LC_uvchr    (UV ch)
bool  isASCII_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isBLANK"><a class="permalink" href="perlapi.html#isBLANK">#</a><code>isBLANK</code></dt>
<dd>

</dd>
<dt id="isBLANK_A"><a class="permalink" href="perlapi.html#isBLANK_A">#</a><code>isBLANK_A</code></dt>
<dd>

</dd>
<dt id="isBLANK_L1"><a class="permalink" href="perlapi.html#isBLANK_L1">#</a><code>isBLANK_L1</code></dt>
<dd>

</dd>
<dt id="isBLANK_uvchr"><a class="permalink" href="perlapi.html#isBLANK_uvchr">#</a><code>isBLANK_uvchr</code></dt>
<dd>

</dd>
<dt id="isBLANK_utf8_safe"><a class="permalink" href="perlapi.html#isBLANK_utf8_safe">#</a><code>isBLANK_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isBLANK_utf8"><a class="permalink" href="perlapi.html#isBLANK_utf8">#</a><code>isBLANK_utf8</code></dt>
<dd>

</dd>
<dt id="isBLANK_LC"><a class="permalink" href="perlapi.html#isBLANK_LC">#</a><code>isBLANK_LC</code></dt>
<dd>

</dd>
<dt id="isBLANK_LC_uvchr"><a class="permalink" href="perlapi.html#isBLANK_LC_uvchr">#</a><code>isBLANK_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isBLANK_LC_utf8_safe"><a class="permalink" href="perlapi.html#isBLANK_LC_utf8_safe">#</a><code>isBLANK_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a character considered to be a blank, analogous to <code>m/[[:blank:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants. Note, however, that some platforms do not have the C library routine <code>isblank()</code>. In these cases, the variants whose names contain <code>LC</code> are the same as the corresponding ones without.</p>

<ul>

<pre><code class="plaintext">bool  isBLANK             (UV ch)
bool  isBLANK_A           (UV ch)
bool  isBLANK_L1          (UV ch)
bool  isBLANK_uvchr       (UV ch)
bool  isBLANK_utf8_safe   (U8 * s, U8 * end)
bool  isBLANK_utf8        (U8 * s, U8 * end)
bool  isBLANK_LC          (UV ch)
bool  isBLANK_LC_uvchr    (UV ch)
bool  isBLANK_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isCNTRL"><a class="permalink" href="perlapi.html#isCNTRL">#</a><code>isCNTRL</code></dt>
<dd>

</dd>
<dt id="isCNTRL_A"><a class="permalink" href="perlapi.html#isCNTRL_A">#</a><code>isCNTRL_A</code></dt>
<dd>

</dd>
<dt id="isCNTRL_L1"><a class="permalink" href="perlapi.html#isCNTRL_L1">#</a><code>isCNTRL_L1</code></dt>
<dd>

</dd>
<dt id="isCNTRL_uvchr"><a class="permalink" href="perlapi.html#isCNTRL_uvchr">#</a><code>isCNTRL_uvchr</code></dt>
<dd>

</dd>
<dt id="isCNTRL_utf8_safe"><a class="permalink" href="perlapi.html#isCNTRL_utf8_safe">#</a><code>isCNTRL_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isCNTRL_utf8"><a class="permalink" href="perlapi.html#isCNTRL_utf8">#</a><code>isCNTRL_utf8</code></dt>
<dd>

</dd>
<dt id="isCNTRL_LC"><a class="permalink" href="perlapi.html#isCNTRL_LC">#</a><code>isCNTRL_LC</code></dt>
<dd>

</dd>
<dt id="isCNTRL_LC_uvchr"><a class="permalink" href="perlapi.html#isCNTRL_LC_uvchr">#</a><code>isCNTRL_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isCNTRL_LC_utf8_safe"><a class="permalink" href="perlapi.html#isCNTRL_LC_utf8_safe">#</a><code>isCNTRL_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a control character, analogous to <code>m/[[:cntrl:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants. On EBCDIC platforms, you almost always want to use the <code>isCNTRL_L1</code> variant.</p>

<ul>

<pre><code class="plaintext">bool  isCNTRL             (UV ch)
bool  isCNTRL_A           (UV ch)
bool  isCNTRL_L1          (UV ch)
bool  isCNTRL_uvchr       (UV ch)
bool  isCNTRL_utf8_safe   (U8 * s, U8 * end)
bool  isCNTRL_utf8        (U8 * s, U8 * end)
bool  isCNTRL_LC          (UV ch)
bool  isCNTRL_LC_uvchr    (UV ch)
bool  isCNTRL_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isDIGIT"><a class="permalink" href="perlapi.html#isDIGIT">#</a><code>isDIGIT</code></dt>
<dd>

</dd>
<dt id="isDIGIT_A"><a class="permalink" href="perlapi.html#isDIGIT_A">#</a><code>isDIGIT_A</code></dt>
<dd>

</dd>
<dt id="isDIGIT_L1"><a class="permalink" href="perlapi.html#isDIGIT_L1">#</a><code>isDIGIT_L1</code></dt>
<dd>

</dd>
<dt id="isDIGIT_uvchr"><a class="permalink" href="perlapi.html#isDIGIT_uvchr">#</a><code>isDIGIT_uvchr</code></dt>
<dd>

</dd>
<dt id="isDIGIT_utf8_safe"><a class="permalink" href="perlapi.html#isDIGIT_utf8_safe">#</a><code>isDIGIT_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isDIGIT_utf8"><a class="permalink" href="perlapi.html#isDIGIT_utf8">#</a><code>isDIGIT_utf8</code></dt>
<dd>

</dd>
<dt id="isDIGIT_LC"><a class="permalink" href="perlapi.html#isDIGIT_LC">#</a><code>isDIGIT_LC</code></dt>
<dd>

</dd>
<dt id="isDIGIT_LC_uvchr"><a class="permalink" href="perlapi.html#isDIGIT_LC_uvchr">#</a><code>isDIGIT_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isDIGIT_LC_utf8_safe"><a class="permalink" href="perlapi.html#isDIGIT_LC_utf8_safe">#</a><code>isDIGIT_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a digit, analogous to <code>m/[[:digit:]]/</code>. Variants <code>isDIGIT_A</code> and <code>isDIGIT_L1</code> are identical to <code>isDIGIT</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isDIGIT             (UV ch)
bool  isDIGIT_A           (UV ch)
bool  isDIGIT_L1          (UV ch)
bool  isDIGIT_uvchr       (UV ch)
bool  isDIGIT_utf8_safe   (U8 * s, U8 * end)
bool  isDIGIT_utf8        (U8 * s, U8 * end)
bool  isDIGIT_LC          (UV ch)
bool  isDIGIT_LC_uvchr    (UV ch)
bool  isDIGIT_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isGRAPH"><a class="permalink" href="perlapi.html#isGRAPH">#</a><code>isGRAPH</code></dt>
<dd>

</dd>
<dt id="isGRAPH_A"><a class="permalink" href="perlapi.html#isGRAPH_A">#</a><code>isGRAPH_A</code></dt>
<dd>

</dd>
<dt id="isGRAPH_L1"><a class="permalink" href="perlapi.html#isGRAPH_L1">#</a><code>isGRAPH_L1</code></dt>
<dd>

</dd>
<dt id="isGRAPH_uvchr"><a class="permalink" href="perlapi.html#isGRAPH_uvchr">#</a><code>isGRAPH_uvchr</code></dt>
<dd>

</dd>
<dt id="isGRAPH_utf8_safe"><a class="permalink" href="perlapi.html#isGRAPH_utf8_safe">#</a><code>isGRAPH_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isGRAPH_utf8"><a class="permalink" href="perlapi.html#isGRAPH_utf8">#</a><code>isGRAPH_utf8</code></dt>
<dd>

</dd>
<dt id="isGRAPH_LC"><a class="permalink" href="perlapi.html#isGRAPH_LC">#</a><code>isGRAPH_LC</code></dt>
<dd>

</dd>
<dt id="isGRAPH_LC_uvchr"><a class="permalink" href="perlapi.html#isGRAPH_LC_uvchr">#</a><code>isGRAPH_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isGRAPH_LC_utf8_safe"><a class="permalink" href="perlapi.html#isGRAPH_LC_utf8_safe">#</a><code>isGRAPH_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a graphic character, analogous to <code>m/[[:graph:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isGRAPH             (UV ch)
bool  isGRAPH_A           (UV ch)
bool  isGRAPH_L1          (UV ch)
bool  isGRAPH_uvchr       (UV ch)
bool  isGRAPH_utf8_safe   (U8 * s, U8 * end)
bool  isGRAPH_utf8        (U8 * s, U8 * end)
bool  isGRAPH_LC          (UV ch)
bool  isGRAPH_LC_uvchr    (UV ch)
bool  isGRAPH_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isIDCONT"><a class="permalink" href="perlapi.html#isIDCONT">#</a><code>isIDCONT</code></dt>
<dd>

</dd>
<dt id="isIDCONT_A"><a class="permalink" href="perlapi.html#isIDCONT_A">#</a><code>isIDCONT_A</code></dt>
<dd>

</dd>
<dt id="isIDCONT_L1"><a class="permalink" href="perlapi.html#isIDCONT_L1">#</a><code>isIDCONT_L1</code></dt>
<dd>

</dd>
<dt id="isIDCONT_uvchr"><a class="permalink" href="perlapi.html#isIDCONT_uvchr">#</a><code>isIDCONT_uvchr</code></dt>
<dd>

</dd>
<dt id="isIDCONT_utf8_safe"><a class="permalink" href="perlapi.html#isIDCONT_utf8_safe">#</a><code>isIDCONT_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isIDCONT_utf8"><a class="permalink" href="perlapi.html#isIDCONT_utf8">#</a><code>isIDCONT_utf8</code></dt>
<dd>

</dd>
<dt id="isIDCONT_LC"><a class="permalink" href="perlapi.html#isIDCONT_LC">#</a><code>isIDCONT_LC</code></dt>
<dd>

</dd>
<dt id="isIDCONT_LC_uvchr"><a class="permalink" href="perlapi.html#isIDCONT_LC_uvchr">#</a><code>isIDCONT_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isIDCONT_LC_utf8_safe"><a class="permalink" href="perlapi.html#isIDCONT_LC_utf8_safe">#</a><code>isIDCONT_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character can be the second or succeeding character of an identifier. This is very close to, but not quite the same as the official Unicode property <code>XID_Continue</code>. The difference is that this returns true only if the input character also matches <a href="perlapi.html#isWORDCHAR">&quot;isWORDCHAR&quot;</a>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isIDCONT             (UV ch)
bool  isIDCONT_A           (UV ch)
bool  isIDCONT_L1          (UV ch)
bool  isIDCONT_uvchr       (UV ch)
bool  isIDCONT_utf8_safe   (U8 * s, U8 * end)
bool  isIDCONT_utf8        (U8 * s, U8 * end)
bool  isIDCONT_LC          (UV ch)
bool  isIDCONT_LC_uvchr    (UV ch)
bool  isIDCONT_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isIDFIRST"><a class="permalink" href="perlapi.html#isIDFIRST">#</a><code>isIDFIRST</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_A"><a class="permalink" href="perlapi.html#isIDFIRST_A">#</a><code>isIDFIRST_A</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_L1"><a class="permalink" href="perlapi.html#isIDFIRST_L1">#</a><code>isIDFIRST_L1</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_uvchr"><a class="permalink" href="perlapi.html#isIDFIRST_uvchr">#</a><code>isIDFIRST_uvchr</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_utf8_safe"><a class="permalink" href="perlapi.html#isIDFIRST_utf8_safe">#</a><code>isIDFIRST_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_utf8"><a class="permalink" href="perlapi.html#isIDFIRST_utf8">#</a><code>isIDFIRST_utf8</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_LC"><a class="permalink" href="perlapi.html#isIDFIRST_LC">#</a><code>isIDFIRST_LC</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_LC_uvchr"><a class="permalink" href="perlapi.html#isIDFIRST_LC_uvchr">#</a><code>isIDFIRST_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isIDFIRST_LC_utf8_safe"><a class="permalink" href="perlapi.html#isIDFIRST_LC_utf8_safe">#</a><code>isIDFIRST_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character can be the first character of an identifier. This is very close to, but not quite the same as the official Unicode property <code>XID_Start</code>. The difference is that this returns true only if the input character also matches <a href="perlapi.html#isWORDCHAR">&quot;isWORDCHAR&quot;</a>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isIDFIRST             (UV ch)
bool  isIDFIRST_A           (UV ch)
bool  isIDFIRST_L1          (UV ch)
bool  isIDFIRST_uvchr       (UV ch)
bool  isIDFIRST_utf8_safe   (U8 * s, U8 * end)
bool  isIDFIRST_utf8        (U8 * s, U8 * end)
bool  isIDFIRST_LC          (UV ch)
bool  isIDFIRST_LC_uvchr    (UV ch)
bool  isIDFIRST_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isLOWER"><a class="permalink" href="perlapi.html#isLOWER">#</a><code>isLOWER</code></dt>
<dd>

</dd>
<dt id="isLOWER_A"><a class="permalink" href="perlapi.html#isLOWER_A">#</a><code>isLOWER_A</code></dt>
<dd>

</dd>
<dt id="isLOWER_L1"><a class="permalink" href="perlapi.html#isLOWER_L1">#</a><code>isLOWER_L1</code></dt>
<dd>

</dd>
<dt id="isLOWER_uvchr"><a class="permalink" href="perlapi.html#isLOWER_uvchr">#</a><code>isLOWER_uvchr</code></dt>
<dd>

</dd>
<dt id="isLOWER_utf8_safe"><a class="permalink" href="perlapi.html#isLOWER_utf8_safe">#</a><code>isLOWER_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isLOWER_utf8"><a class="permalink" href="perlapi.html#isLOWER_utf8">#</a><code>isLOWER_utf8</code></dt>
<dd>

</dd>
<dt id="isLOWER_LC"><a class="permalink" href="perlapi.html#isLOWER_LC">#</a><code>isLOWER_LC</code></dt>
<dd>

</dd>
<dt id="isLOWER_LC_uvchr"><a class="permalink" href="perlapi.html#isLOWER_LC_uvchr">#</a><code>isLOWER_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isLOWER_LC_utf8_safe"><a class="permalink" href="perlapi.html#isLOWER_LC_utf8_safe">#</a><code>isLOWER_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a lowercase character, analogous to <code>m/[[:lower:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants</p>

<ul>

<pre><code class="plaintext">bool  isLOWER             (UV ch)
bool  isLOWER_A           (UV ch)
bool  isLOWER_L1          (UV ch)
bool  isLOWER_uvchr       (UV ch)
bool  isLOWER_utf8_safe   (U8 * s, U8 * end)
bool  isLOWER_utf8        (U8 * s, U8 * end)
bool  isLOWER_LC          (UV ch)
bool  isLOWER_LC_uvchr    (UV ch)
bool  isLOWER_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isOCTAL"><a class="permalink" href="perlapi.html#isOCTAL">#</a><code>isOCTAL</code></dt>
<dd>

</dd>
<dt id="isOCTAL_A"><a class="permalink" href="perlapi.html#isOCTAL_A">#</a><code>isOCTAL_A</code></dt>
<dd>

</dd>
<dt id="isOCTAL_L1"><a class="permalink" href="perlapi.html#isOCTAL_L1">#</a><code>isOCTAL_L1</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is an octal digit, [0-7]. The only two variants are <code>isOCTAL_A</code> and <code>isOCTAL_L1</code>; each is identical to <code>isOCTAL</code>.</p>

<ul>

<pre><code class="plaintext">bool  isOCTAL(UV ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isPRINT"><a class="permalink" href="perlapi.html#isPRINT">#</a><code>isPRINT</code></dt>
<dd>

</dd>
<dt id="isPRINT_A"><a class="permalink" href="perlapi.html#isPRINT_A">#</a><code>isPRINT_A</code></dt>
<dd>

</dd>
<dt id="isPRINT_L1"><a class="permalink" href="perlapi.html#isPRINT_L1">#</a><code>isPRINT_L1</code></dt>
<dd>

</dd>
<dt id="isPRINT_uvchr"><a class="permalink" href="perlapi.html#isPRINT_uvchr">#</a><code>isPRINT_uvchr</code></dt>
<dd>

</dd>
<dt id="isPRINT_utf8_safe"><a class="permalink" href="perlapi.html#isPRINT_utf8_safe">#</a><code>isPRINT_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isPRINT_utf8"><a class="permalink" href="perlapi.html#isPRINT_utf8">#</a><code>isPRINT_utf8</code></dt>
<dd>

</dd>
<dt id="isPRINT_LC"><a class="permalink" href="perlapi.html#isPRINT_LC">#</a><code>isPRINT_LC</code></dt>
<dd>

</dd>
<dt id="isPRINT_LC_uvchr"><a class="permalink" href="perlapi.html#isPRINT_LC_uvchr">#</a><code>isPRINT_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isPRINT_LC_utf8_safe"><a class="permalink" href="perlapi.html#isPRINT_LC_utf8_safe">#</a><code>isPRINT_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a printable character, analogous to <code>m/[[:print:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isPRINT             (UV ch)
bool  isPRINT_A           (UV ch)
bool  isPRINT_L1          (UV ch)
bool  isPRINT_uvchr       (UV ch)
bool  isPRINT_utf8_safe   (U8 * s, U8 * end)
bool  isPRINT_utf8        (U8 * s, U8 * end)
bool  isPRINT_LC          (UV ch)
bool  isPRINT_LC_uvchr    (UV ch)
bool  isPRINT_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isPSXSPC"><a class="permalink" href="perlapi.html#isPSXSPC">#</a><code>isPSXSPC</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_A"><a class="permalink" href="perlapi.html#isPSXSPC_A">#</a><code>isPSXSPC_A</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_L1"><a class="permalink" href="perlapi.html#isPSXSPC_L1">#</a><code>isPSXSPC_L1</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_uvchr"><a class="permalink" href="perlapi.html#isPSXSPC_uvchr">#</a><code>isPSXSPC_uvchr</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_utf8_safe"><a class="permalink" href="perlapi.html#isPSXSPC_utf8_safe">#</a><code>isPSXSPC_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_utf8"><a class="permalink" href="perlapi.html#isPSXSPC_utf8">#</a><code>isPSXSPC_utf8</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_LC"><a class="permalink" href="perlapi.html#isPSXSPC_LC">#</a><code>isPSXSPC_LC</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_LC_uvchr"><a class="permalink" href="perlapi.html#isPSXSPC_LC_uvchr">#</a><code>isPSXSPC_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isPSXSPC_LC_utf8_safe"><a class="permalink" href="perlapi.html#isPSXSPC_LC_utf8_safe">#</a><code>isPSXSPC_LC_utf8_safe</code> </dt>
<dd>

<p>(short for Posix Space) Starting in 5.18, this is identical in all its forms to the corresponding <code>isSPACE()</code> macros. The locale forms of this macro are identical to their corresponding <code>isSPACE()</code> forms in all Perl releases. In releases prior to 5.18, the non-locale forms differ from their <code>isSPACE()</code> forms only in that the <code>isSPACE()</code> forms don&#39;t match a Vertical Tab, and the <code>isPSXSPC()</code> forms do. Otherwise they are identical. Thus this macro is analogous to what <code>m/[[:space:]]/</code> matches in a regular expression. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isPSXSPC             (UV ch)
bool  isPSXSPC_A           (UV ch)
bool  isPSXSPC_L1          (UV ch)
bool  isPSXSPC_uvchr       (UV ch)
bool  isPSXSPC_utf8_safe   (U8 * s, U8 * end)
bool  isPSXSPC_utf8        (U8 * s, U8 * end)
bool  isPSXSPC_LC          (UV ch)
bool  isPSXSPC_LC_uvchr    (UV ch)
bool  isPSXSPC_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isPUNCT"><a class="permalink" href="perlapi.html#isPUNCT">#</a><code>isPUNCT</code></dt>
<dd>

</dd>
<dt id="isPUNCT_A"><a class="permalink" href="perlapi.html#isPUNCT_A">#</a><code>isPUNCT_A</code></dt>
<dd>

</dd>
<dt id="isPUNCT_L1"><a class="permalink" href="perlapi.html#isPUNCT_L1">#</a><code>isPUNCT_L1</code></dt>
<dd>

</dd>
<dt id="isPUNCT_uvchr"><a class="permalink" href="perlapi.html#isPUNCT_uvchr">#</a><code>isPUNCT_uvchr</code></dt>
<dd>

</dd>
<dt id="isPUNCT_utf8_safe"><a class="permalink" href="perlapi.html#isPUNCT_utf8_safe">#</a><code>isPUNCT_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isPUNCT_utf8"><a class="permalink" href="perlapi.html#isPUNCT_utf8">#</a><code>isPUNCT_utf8</code></dt>
<dd>

</dd>
<dt id="isPUNCT_LC"><a class="permalink" href="perlapi.html#isPUNCT_LC">#</a><code>isPUNCT_LC</code></dt>
<dd>

</dd>
<dt id="isPUNCT_LC_uvchr"><a class="permalink" href="perlapi.html#isPUNCT_LC_uvchr">#</a><code>isPUNCT_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isPUNCT_LC_utf8_safe"><a class="permalink" href="perlapi.html#isPUNCT_LC_utf8_safe">#</a><code>isPUNCT_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a punctuation character, analogous to <code>m/[[:punct:]]/</code>. Note that the definition of what is punctuation isn&#39;t as straightforward as one might desire. See <a href="perlrecharclass.html#POSIX-Character-Classes">&quot;POSIX Character Classes&quot; in perlrecharclass</a> for details. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isPUNCT             (UV ch)
bool  isPUNCT_A           (UV ch)
bool  isPUNCT_L1          (UV ch)
bool  isPUNCT_uvchr       (UV ch)
bool  isPUNCT_utf8_safe   (U8 * s, U8 * end)
bool  isPUNCT_utf8        (U8 * s, U8 * end)
bool  isPUNCT_LC          (UV ch)
bool  isPUNCT_LC_uvchr    (UV ch)
bool  isPUNCT_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isSPACE"><a class="permalink" href="perlapi.html#isSPACE">#</a><code>isSPACE</code></dt>
<dd>

</dd>
<dt id="isSPACE_A"><a class="permalink" href="perlapi.html#isSPACE_A">#</a><code>isSPACE_A</code></dt>
<dd>

</dd>
<dt id="isSPACE_L1"><a class="permalink" href="perlapi.html#isSPACE_L1">#</a><code>isSPACE_L1</code></dt>
<dd>

</dd>
<dt id="isSPACE_uvchr"><a class="permalink" href="perlapi.html#isSPACE_uvchr">#</a><code>isSPACE_uvchr</code></dt>
<dd>

</dd>
<dt id="isSPACE_utf8_safe"><a class="permalink" href="perlapi.html#isSPACE_utf8_safe">#</a><code>isSPACE_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isSPACE_utf8"><a class="permalink" href="perlapi.html#isSPACE_utf8">#</a><code>isSPACE_utf8</code></dt>
<dd>

</dd>
<dt id="isSPACE_LC"><a class="permalink" href="perlapi.html#isSPACE_LC">#</a><code>isSPACE_LC</code></dt>
<dd>

</dd>
<dt id="isSPACE_LC_uvchr"><a class="permalink" href="perlapi.html#isSPACE_LC_uvchr">#</a><code>isSPACE_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isSPACE_LC_utf8_safe"><a class="permalink" href="perlapi.html#isSPACE_LC_utf8_safe">#</a><code>isSPACE_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a whitespace character. This is analogous to what <code>m/\s/</code> matches in a regular expression. Starting in Perl 5.18 this also matches what <code>m/[[:space:]]/</code> does. Prior to 5.18, only the locale forms of this macro (the ones with <code>LC</code> in their names) matched precisely what <code>m/[[:space:]]/</code> does. In those releases, the only difference, in the non-locale variants, was that <code>isSPACE()</code> did not match a vertical tab. (See <a href="perlapi.html#isPSXSPC">&quot;isPSXSPC&quot;</a> for a macro that matches a vertical tab in all releases.) See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isSPACE             (UV ch)
bool  isSPACE_A           (UV ch)
bool  isSPACE_L1          (UV ch)
bool  isSPACE_uvchr       (UV ch)
bool  isSPACE_utf8_safe   (U8 * s, U8 * end)
bool  isSPACE_utf8        (U8 * s, U8 * end)
bool  isSPACE_LC          (UV ch)
bool  isSPACE_LC_uvchr    (UV ch)
bool  isSPACE_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isUPPER"><a class="permalink" href="perlapi.html#isUPPER">#</a><code>isUPPER</code></dt>
<dd>

</dd>
<dt id="isUPPER_A"><a class="permalink" href="perlapi.html#isUPPER_A">#</a><code>isUPPER_A</code></dt>
<dd>

</dd>
<dt id="isUPPER_L1"><a class="permalink" href="perlapi.html#isUPPER_L1">#</a><code>isUPPER_L1</code></dt>
<dd>

</dd>
<dt id="isUPPER_uvchr"><a class="permalink" href="perlapi.html#isUPPER_uvchr">#</a><code>isUPPER_uvchr</code></dt>
<dd>

</dd>
<dt id="isUPPER_utf8_safe"><a class="permalink" href="perlapi.html#isUPPER_utf8_safe">#</a><code>isUPPER_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isUPPER_utf8"><a class="permalink" href="perlapi.html#isUPPER_utf8">#</a><code>isUPPER_utf8</code></dt>
<dd>

</dd>
<dt id="isUPPER_LC"><a class="permalink" href="perlapi.html#isUPPER_LC">#</a><code>isUPPER_LC</code></dt>
<dd>

</dd>
<dt id="isUPPER_LC_uvchr"><a class="permalink" href="perlapi.html#isUPPER_LC_uvchr">#</a><code>isUPPER_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isUPPER_LC_utf8_safe"><a class="permalink" href="perlapi.html#isUPPER_LC_utf8_safe">#</a><code>isUPPER_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is an uppercase character, analogous to <code>m/[[:upper:]]/</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isUPPER             (UV ch)
bool  isUPPER_A           (UV ch)
bool  isUPPER_L1          (UV ch)
bool  isUPPER_uvchr       (UV ch)
bool  isUPPER_utf8_safe   (U8 * s, U8 * end)
bool  isUPPER_utf8        (U8 * s, U8 * end)
bool  isUPPER_LC          (UV ch)
bool  isUPPER_LC_uvchr    (UV ch)
bool  isUPPER_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isWORDCHAR"><a class="permalink" href="perlapi.html#isWORDCHAR">#</a><code>isWORDCHAR</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_A"><a class="permalink" href="perlapi.html#isWORDCHAR_A">#</a><code>isWORDCHAR_A</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_L1"><a class="permalink" href="perlapi.html#isWORDCHAR_L1">#</a><code>isWORDCHAR_L1</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_uvchr"><a class="permalink" href="perlapi.html#isWORDCHAR_uvchr">#</a><code>isWORDCHAR_uvchr</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_utf8_safe"><a class="permalink" href="perlapi.html#isWORDCHAR_utf8_safe">#</a><code>isWORDCHAR_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_utf8"><a class="permalink" href="perlapi.html#isWORDCHAR_utf8">#</a><code>isWORDCHAR_utf8</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_LC"><a class="permalink" href="perlapi.html#isWORDCHAR_LC">#</a><code>isWORDCHAR_LC</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_LC_uvchr"><a class="permalink" href="perlapi.html#isWORDCHAR_LC_uvchr">#</a><code>isWORDCHAR_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isWORDCHAR_LC_utf8_safe"><a class="permalink" href="perlapi.html#isWORDCHAR_LC_utf8_safe">#</a><code>isWORDCHAR_LC_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isALNUM"><a class="permalink" href="perlapi.html#isALNUM">#</a><code>isALNUM</code></dt>
<dd>

</dd>
<dt id="isALNUM_A"><a class="permalink" href="perlapi.html#isALNUM_A">#</a><code>isALNUM_A</code></dt>
<dd>

</dd>
<dt id="isALNUM_LC"><a class="permalink" href="perlapi.html#isALNUM_LC">#</a><code>isALNUM_LC</code></dt>
<dd>

</dd>
<dt id="isALNUM_LC_uvchr"><a class="permalink" href="perlapi.html#isALNUM_LC_uvchr">#</a><code>isALNUM_LC_uvchr</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a character that is a word character, analogous to what <code>m/\w/</code> and <code>m/[[:word:]]/</code> match in a regular expression. A word character is an alphabetic character, a decimal digit, a connecting punctuation character (such as an underscore), or a &quot;mark&quot; character that attaches to one of those (like some sort of accent). <code>isALNUM()</code> is a synonym provided for backward compatibility, even though a word character includes more than the standard C language meaning of alphanumeric. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants. <code>isWORDCHAR_A</code>, <code>isWORDCHAR_L1</code>, <code>isWORDCHAR_uvchr</code>, <code>isWORDCHAR_LC</code>, <code>isWORDCHAR_LC_uvchr</code>, <code>isWORDCHAR_LC_utf8</code>, and <code>isWORDCHAR_LC_utf8_safe</code> are also as described there, but additionally include the platform&#39;s native underscore.</p>

<ul>

<pre><code class="plaintext">bool  isWORDCHAR             (UV ch)
bool  isWORDCHAR_A           (UV ch)
bool  isWORDCHAR_L1          (UV ch)
bool  isWORDCHAR_uvchr       (UV ch)
bool  isWORDCHAR_utf8_safe   (U8 * s, U8 * end)
bool  isWORDCHAR_utf8        (U8 * s, U8 * end)
bool  isWORDCHAR_LC          (UV ch)
bool  isWORDCHAR_LC_uvchr    (UV ch)
bool  isWORDCHAR_LC_utf8_safe(U8 * s, U8 *end)
bool  isALNUM                (UV ch)
bool  isALNUM_A              (UV ch)
bool  isALNUM_LC             (UV ch)
bool  isALNUM_LC_uvchr       (UV ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isXDIGIT"><a class="permalink" href="perlapi.html#isXDIGIT">#</a><code>isXDIGIT</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_A"><a class="permalink" href="perlapi.html#isXDIGIT_A">#</a><code>isXDIGIT_A</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_L1"><a class="permalink" href="perlapi.html#isXDIGIT_L1">#</a><code>isXDIGIT_L1</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_uvchr"><a class="permalink" href="perlapi.html#isXDIGIT_uvchr">#</a><code>isXDIGIT_uvchr</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_utf8_safe"><a class="permalink" href="perlapi.html#isXDIGIT_utf8_safe">#</a><code>isXDIGIT_utf8_safe</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_utf8"><a class="permalink" href="perlapi.html#isXDIGIT_utf8">#</a><code>isXDIGIT_utf8</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_LC"><a class="permalink" href="perlapi.html#isXDIGIT_LC">#</a><code>isXDIGIT_LC</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_LC_uvchr"><a class="permalink" href="perlapi.html#isXDIGIT_LC_uvchr">#</a><code>isXDIGIT_LC_uvchr</code></dt>
<dd>

</dd>
<dt id="isXDIGIT_LC_utf8_safe"><a class="permalink" href="perlapi.html#isXDIGIT_LC_utf8_safe">#</a><code>isXDIGIT_LC_utf8_safe</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified character is a hexadecimal digit. In the ASCII range these are <code>[0-9A-Fa-f]</code>. Variants <code>isXDIGIT_A()</code> and <code>isXDIGIT_L1()</code> are identical to <code>isXDIGIT()</code>. See the <a href="perlapi.html#Character-classification">top of this section</a> for an explanation of the variants.</p>

<ul>

<pre><code class="plaintext">bool  isXDIGIT             (UV ch)
bool  isXDIGIT_A           (UV ch)
bool  isXDIGIT_L1          (UV ch)
bool  isXDIGIT_uvchr       (UV ch)
bool  isXDIGIT_utf8_safe   (U8 * s, U8 * end)
bool  isXDIGIT_utf8        (U8 * s, U8 * end)
bool  isXDIGIT_LC          (UV ch)
bool  isXDIGIT_LC_uvchr    (UV ch)
bool  isXDIGIT_LC_utf8_safe(U8 * s, U8 *end)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Compiler-and-Preprocessor-information"><a class="permalink" href="perlapi.html#Compiler-and-Preprocessor-information">#</a><a id="Compiler"></a>Compiler and Preprocessor information</h1>

<dl>

<dt id="CPPLAST"><a class="permalink" href="perlapi.html#CPPLAST">#</a><code>CPPLAST</code> </dt>
<dd>

<p>This symbol is intended to be used along with <code>CPPRUN</code> in the same manner symbol <code>CPPMINUS</code> is used with <code>CPPSTDIN</code>. It contains either &quot;-&quot; or &quot;&quot;.</p>

</dd>
</dl>

<dl>

<dt id="CPPMINUS"><a class="permalink" href="perlapi.html#CPPMINUS">#</a><code>CPPMINUS</code> </dt>
<dd>

<p>This symbol contains the second part of the string which will invoke the C preprocessor on the standard input and produce to standard output. This symbol will have the value &quot;-&quot; if <code>CPPSTDIN</code> needs a minus to specify standard input, otherwise the value is &quot;&quot;.</p>

</dd>
</dl>

<dl>

<dt id="CPPRUN"><a class="permalink" href="perlapi.html#CPPRUN">#</a><code>CPPRUN</code> </dt>
<dd>

<p>This symbol contains the string which will invoke a C preprocessor on the standard input and produce to standard output. It needs to end with <code>CPPLAST</code>, after all other preprocessor flags have been specified. The main difference with <code>CPPSTDIN</code> is that this program will never be a pointer to a shell wrapper, i.e. it will be empty if no preprocessor is available directly to the user. Note that it may well be different from the preprocessor used to compile the C program.</p>

</dd>
</dl>

<dl>

<dt id="CPPSTDIN"><a class="permalink" href="perlapi.html#CPPSTDIN">#</a><code>CPPSTDIN</code> </dt>
<dd>

<p>This symbol contains the first part of the string which will invoke the C preprocessor on the standard input and produce to standard output. Typical value of &quot;cc -E&quot; or &quot;<i>/lib/cpp</i>&quot;, but it can also call a wrapper. See <code><a href="perlapi.html#CPPRUN">&quot;CPPRUN&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_ALWAYS_INLINE"><a class="permalink" href="perlapi.html#HASATTRIBUTE_ALWAYS_INLINE">#</a><code>HASATTRIBUTE_ALWAYS_INLINE</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for functions that should always be inlined.</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_DEPRECATED"><a class="permalink" href="perlapi.html#HASATTRIBUTE_DEPRECATED">#</a><code>HASATTRIBUTE_DEPRECATED</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for marking deprecated <code>APIs</code></p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_FORMAT"><a class="permalink" href="perlapi.html#HASATTRIBUTE_FORMAT">#</a><code>HASATTRIBUTE_FORMAT</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for checking printf-style formats</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_NONNULL"><a class="permalink" href="perlapi.html#HASATTRIBUTE_NONNULL">#</a><code>HASATTRIBUTE_NONNULL</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for nonnull function parms.</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_NORETURN"><a class="permalink" href="perlapi.html#HASATTRIBUTE_NORETURN">#</a><code>HASATTRIBUTE_NORETURN</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for functions that do not return</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_PURE"><a class="permalink" href="perlapi.html#HASATTRIBUTE_PURE">#</a><code>HASATTRIBUTE_PURE</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for pure functions</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_UNUSED"><a class="permalink" href="perlapi.html#HASATTRIBUTE_UNUSED">#</a><code>HASATTRIBUTE_UNUSED</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for unused variables and arguments</p>

</dd>
</dl>

<dl>

<dt id="HASATTRIBUTE_WARN_UNUSED_RESULT"><a class="permalink" href="perlapi.html#HASATTRIBUTE_WARN_UNUSED_RESULT">#</a><code>HASATTRIBUTE_WARN_UNUSED_RESULT</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for warning on unused results</p>

</dd>
</dl>

<dl>

<dt id="HAS_BUILTIN_ADD_OVERFLOW"><a class="permalink" href="perlapi.html#HAS_BUILTIN_ADD_OVERFLOW">#</a><code>HAS_BUILTIN_ADD_OVERFLOW</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the compiler supports <code>__builtin_add_overflow</code> for adding integers with overflow checks.</p>

</dd>
</dl>

<dl>

<dt id="HAS_BUILTIN_CHOOSE_EXPR"><a class="permalink" href="perlapi.html#HAS_BUILTIN_CHOOSE_EXPR">#</a><code>HAS_BUILTIN_CHOOSE_EXPR</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> builtin for compile-time ternary-like expressions</p>

</dd>
</dl>

<dl>

<dt id="HAS_BUILTIN_EXPECT"><a class="permalink" href="perlapi.html#HAS_BUILTIN_EXPECT">#</a><code>HAS_BUILTIN_EXPECT</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> builtin for telling that certain values are more likely</p>

</dd>
</dl>

<dl>

<dt id="HAS_BUILTIN_MUL_OVERFLOW"><a class="permalink" href="perlapi.html#HAS_BUILTIN_MUL_OVERFLOW">#</a><code>HAS_BUILTIN_MUL_OVERFLOW</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the compiler supports <code>__builtin_mul_overflow</code> for multiplying integers with overflow checks.</p>

</dd>
</dl>

<dl>

<dt id="HAS_BUILTIN_SUB_OVERFLOW"><a class="permalink" href="perlapi.html#HAS_BUILTIN_SUB_OVERFLOW">#</a><code>HAS_BUILTIN_SUB_OVERFLOW</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the compiler supports <code>__builtin_sub_overflow</code> for subtracting integers with overflow checks.</p>

</dd>
</dl>

<dl>

<dt id="HAS_C99_VARIADIC_MACROS"><a class="permalink" href="perlapi.html#HAS_C99_VARIADIC_MACROS">#</a><code>HAS_C99_VARIADIC_MACROS</code> </dt>
<dd>

<p>If defined, the compiler supports C99 variadic macros.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STATIC_INLINE"><a class="permalink" href="perlapi.html#HAS_STATIC_INLINE">#</a><code>HAS_STATIC_INLINE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the C compiler supports C99-style static inline. That is, the function can&#39;t be called from another translation unit.</p>

</dd>
</dl>

<dl>

<dt id="MEM_ALIGNBYTES"><a class="permalink" href="perlapi.html#MEM_ALIGNBYTES">#</a><code>MEM_ALIGNBYTES</code> </dt>
<dd>

<p>This symbol contains the number of bytes required to align a double, or a long double when applicable. Usual values are 2, 4 and 8. The default is eight, for safety. For cross-compiling or multiarch support, Configure will set a minimum of 8.</p>

</dd>
</dl>

<dl>

<dt id="PERL_STATIC_INLINE"><a class="permalink" href="perlapi.html#PERL_STATIC_INLINE">#</a><code>PERL_STATIC_INLINE</code> </dt>
<dd>

<p>This symbol gives the best-guess incantation to use for static inline functions. If <code>HAS_STATIC_INLINE</code> is defined, this will give C99-style inline. If <code>HAS_STATIC_INLINE</code> is not defined, this will give a plain &#39;static&#39;. It will always be defined to something that gives static linkage. Possibilities include</p>

<pre><code class="plaintext">static inline       (c99)
static __inline__   (gcc -ansi)
static __inline     (MSVC)
static _inline      (older MSVC)
static              (c89 compilers)</code></pre>

</dd>
</dl>

<dl>

<dt id="U32_ALIGNMENT_REQUIRED"><a class="permalink" href="perlapi.html#U32_ALIGNMENT_REQUIRED">#</a><code>U32_ALIGNMENT_REQUIRED</code> </dt>
<dd>

<p>This symbol, if defined, indicates that you must access character data through U32-aligned pointers.</p>

</dd>
</dl>

<h1 id="Compiler-directives"><a class="permalink" href="perlapi.html#Compiler-directives">#</a><a id="Compiler1"></a>Compiler directives</h1>

<dl>

<dt id="ASSUME"><a class="permalink" href="perlapi.html#ASSUME">#</a><code>ASSUME</code> </dt>
<dd>

<p><code>ASSUME</code> is like <code>assert()</code>, but it has a benefit in a release build. It is a hint to a compiler about a statement of fact in a function call free expression, which allows the compiler to generate better machine code. In a debug build, <code>ASSUME(x)</code> is a synonym for <code>assert(x)</code>. <code>ASSUME(0)</code> means the control path is unreachable. In a for loop, <code>ASSUME</code> can be used to hint that a loop will run at least X times. <code>ASSUME</code> is based off MSVC&#39;s <code>__assume</code> intrinsic function, see its documents for more details.</p>

<ul>

<pre><code class="plaintext">ASSUME(bool expr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dNOOP"><a class="permalink" href="perlapi.html#dNOOP">#</a><code>dNOOP</code> </dt>
<dd>

<p>Declare nothing; typically used as a placeholder to replace something that used to declare something. Works on compilers that require declarations before any code.</p>

<ul>

<pre><code>dNOOP;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="END_EXTERN_C"><a class="permalink" href="perlapi.html#END_EXTERN_C">#</a><code>END_EXTERN_C</code> </dt>
<dd>

<p>When not compiling using C++, expands to nothing. Otherwise ends a section of code already begun by a <code><a href="perlapi.html#START_EXTERN_C">&quot;START_EXTERN_C&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">END_EXTERN_C</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="EXTERN_C"><a class="permalink" href="perlapi.html#EXTERN_C">#</a><code>EXTERN_C</code> </dt>
<dd>

<p>When not compiling using C++, expands to nothing. Otherwise is used in a declaration of a function to indicate the function should have external C linkage. This is required for things to work for just about all functions with external linkage compiled into perl. Often, you can use <code><a href="perlapi.html#START_EXTERN_C">&quot;START_EXTERN_C&quot;</a></code> ... <code><a href="perlapi.html#END_EXTERN_C">&quot;END_EXTERN_C&quot;</a></code> blocks surrounding all your code that you need to have this linkage.</p>

<p>Example usage:</p>

<pre><code>EXTERN_C int flock(int fd, int op);</code></pre>

</dd>
</dl>

<dl>

<dt id="LIKELY"><a class="permalink" href="perlapi.html#LIKELY">#</a><code>LIKELY</code> </dt>
<dd>

<p>Returns the input unchanged, but at the same time it gives a branch prediction hint to the compiler that this condition is likely to be true.</p>

<ul>

<pre><code class="plaintext">LIKELY(bool expr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="NOOP"><a class="permalink" href="perlapi.html#NOOP">#</a><code>NOOP</code> </dt>
<dd>

<p>Do nothing; typically used as a placeholder to replace something that used to do something.</p>

<ul>

<pre><code>NOOP;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_UNUSED_ARG"><a class="permalink" href="perlapi.html#PERL_UNUSED_ARG">#</a><code>PERL_UNUSED_ARG</code> </dt>
<dd>

<p>This is used to suppress compiler warnings that a parameter to a function is not used. This situation can arise, for example, when a parameter is needed under some configuration conditions, but not others, so that C preprocessor conditional compilation causes it be used just some times.</p>

<ul>

<pre><code>PERL_UNUSED_ARG(void x);</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_UNUSED_CONTEXT"><a class="permalink" href="perlapi.html#PERL_UNUSED_CONTEXT">#</a><code>PERL_UNUSED_CONTEXT</code> </dt>
<dd>

<p>This is used to suppress compiler warnings that the thread context parameter to a function is not used. This situation can arise, for example, when a C preprocessor conditional compilation causes it be used just some times.</p>

<ul>

<pre><code>PERL_UNUSED_CONTEXT;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_UNUSED_DECL"><a class="permalink" href="perlapi.html#PERL_UNUSED_DECL">#</a><code>PERL_UNUSED_DECL</code> </dt>
<dd>

<p>Tells the compiler that the parameter in the function prototype just before it is not necessarily expected to be used in the function. Not that many compilers understand this, so this should only be used in cases where <code><a href="perlapi.html#PERL_UNUSED_ARG">&quot;PERL_UNUSED_ARG&quot;</a></code> can&#39;t conveniently be used.</p>

<p>Example usage:</p>

<ul>

<pre><code class="plaintext">Signal_t
Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
                      void *uap PERL_UNUSED_DECL, bool safe)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_UNUSED_RESULT"><a class="permalink" href="perlapi.html#PERL_UNUSED_RESULT">#</a><code>PERL_UNUSED_RESULT</code> </dt>
<dd>

<p>This macro indicates to discard the return value of the function call inside it, <i>e.g.</i>,</p>

<pre><code class="plaintext">PERL_UNUSED_RESULT(foo(a, b))</code></pre>

<p>The main reason for this is that the combination of <code>gcc -Wunused-result</code> (part of <code>-Wall</code>) and the <code>__attribute__((warn_unused_result))</code> cannot be silenced with casting to <code>void</code>. This causes trouble when the system header files use the attribute.</p>

<p>Use <code>PERL_UNUSED_RESULT</code> sparingly, though, since usually the warning is there for a good reason: you might lose success/failure information, or leak resources, or changes in resources.</p>

<p>But sometimes you just want to ignore the return value, <i>e.g.</i>, on codepaths soon ending up in abort, or in &quot;best effort&quot; attempts, or in situations where there is no good way to handle failures.</p>

<p>Sometimes <code>PERL_UNUSED_RESULT</code> might not be the most natural way: another possibility is that you can capture the return value and use <code><a href="perlapi.html#PERL_UNUSED_VAR">&quot;PERL_UNUSED_VAR&quot;</a></code> on that.</p>

<ul>

<pre><code class="plaintext">PERL_UNUSED_RESULT(void x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_UNUSED_VAR"><a class="permalink" href="perlapi.html#PERL_UNUSED_VAR">#</a><code>PERL_UNUSED_VAR</code> </dt>
<dd>

<p>This is used to suppress compiler warnings that the variable <i>x</i> is not used. This situation can arise, for example, when a C preprocessor conditional compilation causes it be used just some times.</p>

<ul>

<pre><code>PERL_UNUSED_VAR(void x);</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_USE_GCC_BRACE_GROUPS"><a class="permalink" href="perlapi.html#PERL_USE_GCC_BRACE_GROUPS">#</a><code>PERL_USE_GCC_BRACE_GROUPS</code> </dt>
<dd>

<p>This C pre-processor value, if defined, indicates that it is permissible to use the GCC brace groups extension. This extension, of the form</p>

<pre><code class="plaintext">({ statement ... })</code></pre>

<p>turns the block consisting of <i>statements ...</i> into an expression with a value, unlike plain C language blocks. This can present optimization possibilities, <b>BUT</b> you generally need to specify an alternative in case this ability doesn&#39;t exist or has otherwise been forbidden.</p>

<p>Example usage:</p>

<ul>

<pre><code class="plaintext">#ifdef PERL_USE_GCC_BRACE_GROUPS
  ...
#else
  ...
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="START_EXTERN_C"><a class="permalink" href="perlapi.html#START_EXTERN_C">#</a><code>START_EXTERN_C</code> </dt>
<dd>

<p>When not compiling using C++, expands to nothing. Otherwise begins a section of code in which every function will effectively have <code><a href="perlapi.html#EXTERN_C">&quot;EXTERN_C&quot;</a></code> applied to it, that is to have external C linkage. The section is ended by a <code><a href="perlapi.html#END_EXTERN_C">&quot;END_EXTERN_C&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">START_EXTERN_C</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="STATIC"><a class="permalink" href="perlapi.html#STATIC">#</a><code>STATIC</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="STMT_START"><a class="permalink" href="perlapi.html#STMT_START">#</a><code>STMT_START</code></dt>
<dd>

</dd>
<dt id="STMT_END"><a class="permalink" href="perlapi.html#STMT_END">#</a><code>STMT_END</code> </dt>
<dd>

<p>This allows a series of statements in a macro to be used as a single statement, as in</p>

<pre><code class="plaintext">if (x) STMT_START { ... } STMT_END else ...</code></pre>

<p>Note that you can&#39;t return a value out of them, which limits their utility. But see <code><a href="perlapi.html#PERL_USE_GCC_BRACE_GROUPS">&quot;PERL_USE_GCC_BRACE_GROUPS&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="UNLIKELY"><a class="permalink" href="perlapi.html#UNLIKELY">#</a><code>UNLIKELY</code> </dt>
<dd>

<p>Returns the input unchanged, but at the same time it gives a branch prediction hint to the compiler that this condition is likely to be false.</p>

<ul>

<pre><code class="plaintext">UNLIKELY(bool expr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="__ASSERT_"><a class="permalink" href="perlapi.html#__ASSERT_">#</a><a id="ASSERT_"></a><code>__ASSERT_</code> </dt>
<dd>

<p>This is a helper macro to avoid preprocessor issues, replaced by nothing unless under DEBUGGING, where it expands to an assert of its argument, followed by a comma (hence the comma operator). If we just used a straight assert(), we would get a comma with nothing before it when not DEBUGGING.</p>

<ul>

<pre><code class="plaintext">__ASSERT_(bool expr)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Compile-time-scope-hooks"><a class="permalink" href="perlapi.html#Compile-time-scope-hooks">#</a><a id="Compile"></a>Compile-time scope hooks</h1>

<dl>

<dt id="BhkDISABLE"><a class="permalink" href="perlapi.html#BhkDISABLE">#</a><code>BhkDISABLE</code> </dt>
<dd>

<p>NOTE: <code>BhkDISABLE</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Temporarily disable an entry in this BHK structure, by clearing the appropriate flag. <code>which</code> is a preprocessor token indicating which entry to disable.</p>

<ul>

<pre><code class="plaintext">void  BhkDISABLE(BHK *hk, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="BhkENABLE"><a class="permalink" href="perlapi.html#BhkENABLE">#</a><code>BhkENABLE</code> </dt>
<dd>

<p>NOTE: <code>BhkENABLE</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Re-enable an entry in this BHK structure, by setting the appropriate flag. <code>which</code> is a preprocessor token indicating which entry to enable. This will assert (under -DDEBUGGING) if the entry doesn&#39;t contain a valid pointer.</p>

<ul>

<pre><code class="plaintext">void  BhkENABLE(BHK *hk, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="BhkENTRY_set"><a class="permalink" href="perlapi.html#BhkENTRY_set">#</a><code>BhkENTRY_set</code> </dt>
<dd>

<p>NOTE: <code>BhkENTRY_set</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Set an entry in the BHK structure, and set the flags to indicate it is valid. <code>which</code> is a preprocessing token indicating which entry to set. The type of <code>ptr</code> depends on the entry.</p>

<ul>

<pre><code class="plaintext">void  BhkENTRY_set(BHK *hk, which, void *ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="blockhook_register"><a class="permalink" href="perlapi.html#blockhook_register">#</a><code>blockhook_register</code> </dt>
<dd>

<p>NOTE: <code>blockhook_register</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Register a set of hooks to be called when the Perl lexical scope changes at compile time. See <a href="perlguts.html#Compile-time-scope-hooks">&quot;Compile-time scope hooks&quot; in perlguts</a>.</p>

<p>NOTE: <code>blockhook_register</code> must be explicitly called as <code>Perl_blockhook_register</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_blockhook_register(pTHX_ BHK *hk)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Concurrency"><a class="permalink" href="perlapi.html#Concurrency">#</a>Concurrency</h1>

<dl>

<dt id="aTHX"><a class="permalink" href="perlapi.html#aTHX">#</a><code>aTHX</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="aTHX_"><a class="permalink" href="perlapi.html#aTHX_">#</a><code>aTHX_</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="CPERLscope"><a class="permalink" href="perlapi.html#CPERLscope">#</a><code>CPERLscope</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>CPERLscope</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Now a no-op.</p>

<ul>

<pre><code class="plaintext">void  CPERLscope(void x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dTHR"><a class="permalink" href="perlapi.html#dTHR">#</a><code>dTHR</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="dTHX"><a class="permalink" href="perlapi.html#dTHX">#</a><code>dTHX</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="dTHXa"><a class="permalink" href="perlapi.html#dTHXa">#</a><code>dTHXa</code> </dt>
<dd>

<p>On threaded perls, set <code>pTHX</code> to <code>a</code>; on unthreaded perls, do nothing</p>

</dd>
</dl>

<dl>

<dt id="dTHXoa"><a class="permalink" href="perlapi.html#dTHXoa">#</a><code>dTHXoa</code> </dt>
<dd>

<p>Now a synonym for <code><a href="perlapi.html#dTHXa">&quot;dTHXa&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="dVAR"><a class="permalink" href="perlapi.html#dVAR">#</a><code>dVAR</code> </dt>
<dd>

<p>This is now a synonym for dNOOP: declare nothing</p>

</dd>
</dl>

<dl>

<dt id="GETENV_PRESERVES_OTHER_THREAD"><a class="permalink" href="perlapi.html#GETENV_PRESERVES_OTHER_THREAD">#</a><code>GETENV_PRESERVES_OTHER_THREAD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the getenv system call doesn&#39;t zap the static buffer of <code>getenv()</code> in a different thread. The typical <code>getenv()</code> implementation will return a pointer to the proper position in **environ. But some may instead copy them to a static buffer in <code>getenv()</code>. If there is a per-thread instance of that buffer, or the return points to **environ, then a many-reader/1-writer mutex will work; otherwise an exclusive locking mutex is required to prevent races.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PTHREAD_ATFORK"><a class="permalink" href="perlapi.html#HAS_PTHREAD_ATFORK">#</a><code>HAS_PTHREAD_ATFORK</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>pthread_atfork</code> routine is available to setup fork handlers.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PTHREAD_ATTR_SETSCOPE"><a class="permalink" href="perlapi.html#HAS_PTHREAD_ATTR_SETSCOPE">#</a><code>HAS_PTHREAD_ATTR_SETSCOPE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>pthread_attr_setscope</code> system call is available to set the contention scope attribute of a thread attribute object.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PTHREAD_YIELD"><a class="permalink" href="perlapi.html#HAS_PTHREAD_YIELD">#</a><code>HAS_PTHREAD_YIELD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>pthread_yield</code> routine is available to yield the execution of the current thread. <code>sched_yield</code> is preferable to <code>pthread_yield</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SCHED_YIELD"><a class="permalink" href="perlapi.html#HAS_SCHED_YIELD">#</a><code>HAS_SCHED_YIELD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>sched_yield</code> routine is available to yield the execution of the current thread. <code>sched_yield</code> is preferable to <code>pthread_yield</code>.</p>

</dd>
</dl>

<dl>

<dt id="I_MACH_CTHREADS"><a class="permalink" href="perlapi.html#I_MACH_CTHREADS">#</a><code>I_MACH_CTHREADS</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>mach/cthreads.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_MACH_CTHREADS
    #include &lt;mach_cthreads.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_PTHREAD"><a class="permalink" href="perlapi.html#I_PTHREAD">#</a><code>I_PTHREAD</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>pthread.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_PTHREAD
    #include &lt;pthread.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MULTIPLICITY"><a class="permalink" href="perlapi.html#MULTIPLICITY">#</a><code>MULTIPLICITY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use multiplicity.</p>

</dd>
</dl>

<dl>

<dt id="OLD_PTHREADS_API"><a class="permalink" href="perlapi.html#OLD_PTHREADS_API">#</a><code>OLD_PTHREADS_API</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use the old draft <code>POSIX</code> threads <code>API</code>.</p>

</dd>
</dl>

<dl>

<dt id="OLD_PTHREAD_CREATE_JOINABLE"><a class="permalink" href="perlapi.html#OLD_PTHREAD_CREATE_JOINABLE">#</a><code>OLD_PTHREAD_CREATE_JOINABLE</code> </dt>
<dd>

<p>This symbol, if defined, indicates how to create pthread in joinable (aka undetached) state. <code>NOTE</code>: not defined if <i>pthread.h</i> already has defined <code>PTHREAD_CREATE_JOINABLE</code> (the new version of the constant). If defined, known values are <code>PTHREAD_CREATE_UNDETACHED</code> and <code>__UNDETACHED</code>.</p>

</dd>
</dl>

<dl>

<dt id="pTHX"><a class="permalink" href="perlapi.html#pTHX">#</a><code>pTHX</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="pTHX_"><a class="permalink" href="perlapi.html#pTHX_">#</a><code>pTHX_</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="SCHED_YIELD"><a class="permalink" href="perlapi.html#SCHED_YIELD">#</a><code>SCHED_YIELD</code> </dt>
<dd>

<p>This symbol defines the way to yield the execution of the current thread. Known ways are <code>sched_yield</code>, <code>pthread_yield</code>, and <code>pthread_yield</code> with <code>NULL</code>.</p>

</dd>
</dl>

<dl>

<dt id="SVf"><a class="permalink" href="perlapi.html#SVf">#</a><code>SVf</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVfARG"><a class="permalink" href="perlapi.html#SVfARG">#</a><code>SVfARG</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SVfARG(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="COP-Hint-Hashes"><a class="permalink" href="perlapi.html#COP-Hint-Hashes">#</a><a id="COP"></a>COP Hint Hashes</h1>

<dl>

<dt id="cop_fetch_label"><a class="permalink" href="perlapi.html#cop_fetch_label">#</a><code>cop_fetch_label</code> </dt>
<dd>

<p>NOTE: <code>cop_fetch_label</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Returns the label attached to a cop, and stores its length in bytes into <code>*len</code>. Upon return, <code>*flags</code> will be set to either <code>SVf_UTF8</code> or 0.</p>

<p>Alternatively, use the macro <code><a href="perlapi.html#CopLABEL_len_flags">&quot;CopLABEL_len_flags&quot;</a></code>; or if you don&#39;t need to know if the label is UTF-8 or not, the macro <code><a href="perlapi.html#CopLABEL_len">&quot;CopLABEL_len&quot;</a></code>; or if you additionally dont need to know the length, <code><a href="perlapi.html#CopLABEL">&quot;CopLABEL&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">const char *  cop_fetch_label(COP *const cop, STRLEN *len,
                              U32 *flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILE"><a class="permalink" href="perlapi.html#CopFILE">#</a><code>CopFILE</code> </dt>
<dd>

<p>Returns the name of the file associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">const char *  CopFILE(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILEAV"><a class="permalink" href="perlapi.html#CopFILEAV">#</a><code>CopFILEAV</code> </dt>
<dd>

<p>Returns the AV associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">AV *  CopFILEAV(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILEGV"><a class="permalink" href="perlapi.html#CopFILEGV">#</a><code>CopFILEGV</code> </dt>
<dd>

<p>Returns the GV associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">GV *  CopFILEGV(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILEGV_set"><a class="permalink" href="perlapi.html#CopFILEGV_set">#</a><code>CopFILEGV_set</code> </dt>
<dd>

<p>Available only on unthreaded perls. Makes <code>pv</code> the name of the file associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">void  CopFILEGV_set(COP * c, GV * gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILE_set"><a class="permalink" href="perlapi.html#CopFILE_set">#</a><code>CopFILE_set</code> </dt>
<dd>

<p>Makes <code>pv</code> the name of the file associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">void  CopFILE_set(COP * c, const char * pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopFILESV"><a class="permalink" href="perlapi.html#CopFILESV">#</a><code>CopFILESV</code> </dt>
<dd>

<p>Returns the SV associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">SV *  CopFILESV(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_2hv"><a class="permalink" href="perlapi.html#cophh_2hv">#</a><code>cophh_2hv</code> </dt>
<dd>

<p>NOTE: <code>cophh_2hv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Generates and returns a standard Perl hash representing the full set of key/value pairs in the cop hints hash <code>cophh</code>. <code>flags</code> is currently unused and must be zero.</p>

<ul>

<pre><code class="plaintext">HV *  cophh_2hv(const COPHH *cophh, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_copy"><a class="permalink" href="perlapi.html#cophh_copy">#</a><code>cophh_copy</code> </dt>
<dd>

<p>NOTE: <code>cophh_copy</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Make and return a complete copy of the cop hints hash <code>cophh</code>.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_copy(COPHH *cophh)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_delete_pv"><a class="permalink" href="perlapi.html#cophh_delete_pv">#</a><code>cophh_delete_pv</code> </dt>
<dd>

<p>NOTE: <code>cophh_delete_pv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_delete_pvn">&quot;cophh_delete_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_delete_pv(COPHH *cophh, char *key, U32 hash,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_delete_pvn"><a class="permalink" href="perlapi.html#cophh_delete_pvn">#</a><code>cophh_delete_pvn</code> </dt>
<dd>

<p>NOTE: <code>cophh_delete_pvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Delete a key and its associated value from the cop hints hash <code>cophh</code>, and returns the modified hash. The returned hash pointer is in general not the same as the hash pointer that was passed in. The input hash is consumed by the function, and the pointer to it must not be subsequently used. Use <a href="perlapi.html#cophh_copy">&quot;cophh_copy&quot;</a> if you need both hashes.</p>

<p>The key is specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_delete_pvn(COPHH *cophh, const char *keypv,
                          STRLEN keylen, U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_delete_pvs"><a class="permalink" href="perlapi.html#cophh_delete_pvs">#</a><code>cophh_delete_pvs</code> </dt>
<dd>

<p>NOTE: <code>cophh_delete_pvs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_delete_pvn">&quot;cophh_delete_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_delete_pvs(COPHH *cophh, &quot;key&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_delete_sv"><a class="permalink" href="perlapi.html#cophh_delete_sv">#</a><code>cophh_delete_sv</code> </dt>
<dd>

<p>NOTE: <code>cophh_delete_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_delete_pvn">&quot;cophh_delete_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_delete_sv(COPHH *cophh, SV *key, U32 hash,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_exists_pv"><a class="permalink" href="perlapi.html#cophh_exists_pv">#</a><code>cophh_exists_pv</code> </dt>
<dd>

<p>NOTE: <code>cophh_exists_pv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_exists_pvn">&quot;cophh_exists_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">bool  cophh_exists_pv(const COPHH *cophh, const char *key,
                      U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_exists_pvn"><a class="permalink" href="perlapi.html#cophh_exists_pvn">#</a><code>cophh_exists_pvn</code> </dt>
<dd>

<p>NOTE: <code>cophh_exists_pvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Look up the entry in the cop hints hash <code>cophh</code> with the key specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed. Returns true if a value exists, and false otherwise.</p>

<ul>

<pre><code class="plaintext">bool  cophh_exists_pvn(const COPHH *cophh, const char *keypv,
                       STRLEN keylen, U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_exists_pvs"><a class="permalink" href="perlapi.html#cophh_exists_pvs">#</a><code>cophh_exists_pvs</code> </dt>
<dd>

<p>NOTE: <code>cophh_exists_pvs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_exists_pvn">&quot;cophh_exists_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">bool  cophh_exists_pvs(const COPHH *cophh, &quot;key&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_exists_sv"><a class="permalink" href="perlapi.html#cophh_exists_sv">#</a><code>cophh_exists_sv</code> </dt>
<dd>

<p>NOTE: <code>cophh_exists_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_exists_pvn">&quot;cophh_exists_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">bool  cophh_exists_sv(const COPHH *cophh, SV *key, U32 hash,
                      U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_fetch_pv"><a class="permalink" href="perlapi.html#cophh_fetch_pv">#</a><code>cophh_fetch_pv</code> </dt>
<dd>

<p>NOTE: <code>cophh_fetch_pv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_fetch_pvn">&quot;cophh_fetch_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV *  cophh_fetch_pv(const COPHH *cophh, const char *key,
                     U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_fetch_pvn"><a class="permalink" href="perlapi.html#cophh_fetch_pvn">#</a><code>cophh_fetch_pvn</code> </dt>
<dd>

<p>NOTE: <code>cophh_fetch_pvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Look up the entry in the cop hints hash <code>cophh</code> with the key specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed. Returns a mortal scalar copy of the value associated with the key, or <code>&amp;PL_sv_placeholder</code> if there is no value associated with the key.</p>

<ul>

<pre><code class="plaintext">SV *  cophh_fetch_pvn(const COPHH *cophh, const char *keypv,
                      STRLEN keylen, U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_fetch_pvs"><a class="permalink" href="perlapi.html#cophh_fetch_pvs">#</a><code>cophh_fetch_pvs</code> </dt>
<dd>

<p>NOTE: <code>cophh_fetch_pvs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_fetch_pvn">&quot;cophh_fetch_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">SV *  cophh_fetch_pvs(const COPHH *cophh, &quot;key&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_fetch_sv"><a class="permalink" href="perlapi.html#cophh_fetch_sv">#</a><code>cophh_fetch_sv</code> </dt>
<dd>

<p>NOTE: <code>cophh_fetch_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_fetch_pvn">&quot;cophh_fetch_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV *  cophh_fetch_sv(const COPHH *cophh, SV *key, U32 hash,
                     U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_free"><a class="permalink" href="perlapi.html#cophh_free">#</a><code>cophh_free</code> </dt>
<dd>

<p>NOTE: <code>cophh_free</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Discard the cop hints hash <code>cophh</code>, freeing all resources associated with it.</p>

<ul>

<pre><code class="plaintext">void  cophh_free(COPHH *cophh)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_new_empty"><a class="permalink" href="perlapi.html#cophh_new_empty">#</a><code>cophh_new_empty</code> </dt>
<dd>

<p>NOTE: <code>cophh_new_empty</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Generate and return a fresh cop hints hash containing no entries.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_new_empty()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_store_pv"><a class="permalink" href="perlapi.html#cophh_store_pv">#</a><code>cophh_store_pv</code> </dt>
<dd>

<p>NOTE: <code>cophh_store_pv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_store_pvn">&quot;cophh_store_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_store_pv(COPHH *cophh, const char *key, U32 hash,
                        SV *value, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_store_pvn"><a class="permalink" href="perlapi.html#cophh_store_pvn">#</a><code>cophh_store_pvn</code> </dt>
<dd>

<p>NOTE: <code>cophh_store_pvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Stores a value, associated with a key, in the cop hints hash <code>cophh</code>, and returns the modified hash. The returned hash pointer is in general not the same as the hash pointer that was passed in. The input hash is consumed by the function, and the pointer to it must not be subsequently used. Use <a href="perlapi.html#cophh_copy">&quot;cophh_copy&quot;</a> if you need both hashes.</p>

<p>The key is specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed.</p>

<p><code>value</code> is the scalar value to store for this key. <code>value</code> is copied by this function, which thus does not take ownership of any reference to it, and later changes to the scalar will not be reflected in the value visible in the cop hints hash. Complex types of scalar will not be stored with referential integrity, but will be coerced to strings.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_store_pvn(COPHH *cophh, const char *keypv,
                         STRLEN keylen, U32 hash, SV *value,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_store_pvs"><a class="permalink" href="perlapi.html#cophh_store_pvs">#</a><code>cophh_store_pvs</code> </dt>
<dd>

<p>NOTE: <code>cophh_store_pvs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_store_pvn">&quot;cophh_store_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_store_pvs(COPHH *cophh, &quot;key&quot;, SV *value,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cophh_store_sv"><a class="permalink" href="perlapi.html#cophh_store_sv">#</a><code>cophh_store_sv</code> </dt>
<dd>

<p>NOTE: <code>cophh_store_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#cophh_store_pvn">&quot;cophh_store_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">COPHH *  cophh_store_sv(COPHH *cophh, SV *key, U32 hash,
                        SV *value, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_2hv"><a class="permalink" href="perlapi.html#cop_hints_2hv">#</a><code>cop_hints_2hv</code> </dt>
<dd>

<p>Generates and returns a standard Perl hash representing the full set of hint entries in the cop <code>cop</code>. <code>flags</code> is currently unused and must be zero.</p>

<ul>

<pre><code class="plaintext">HV *  cop_hints_2hv(const COP *cop, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_exists_pv"><a class="permalink" href="perlapi.html#cop_hints_exists_pv">#</a><code>cop_hints_exists_pv</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_exists_pvn">&quot;cop_hints_exists_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">bool  cop_hints_exists_pv(const COP *cop, const char *key,
                          U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_exists_pvn"><a class="permalink" href="perlapi.html#cop_hints_exists_pvn">#</a><code>cop_hints_exists_pvn</code> </dt>
<dd>

<p>Look up the hint entry in the cop <code>cop</code> with the key specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed. Returns true if a value exists, and false otherwise.</p>

<ul>

<pre><code class="plaintext">bool  cop_hints_exists_pvn(const COP *cop, const char *keypv,
                           STRLEN keylen, U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_exists_pvs"><a class="permalink" href="perlapi.html#cop_hints_exists_pvs">#</a><code>cop_hints_exists_pvs</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_exists_pvn">&quot;cop_hints_exists_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">bool  cop_hints_exists_pvs(const COP *cop, &quot;key&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_exists_sv"><a class="permalink" href="perlapi.html#cop_hints_exists_sv">#</a><code>cop_hints_exists_sv</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_exists_pvn">&quot;cop_hints_exists_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">bool  cop_hints_exists_sv(const COP *cop, SV *key, U32 hash,
                          U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_fetch_pv"><a class="permalink" href="perlapi.html#cop_hints_fetch_pv">#</a><code>cop_hints_fetch_pv</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_fetch_pvn">&quot;cop_hints_fetch_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV *  cop_hints_fetch_pv(const COP *cop, const char *key,
                         U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_fetch_pvn"><a class="permalink" href="perlapi.html#cop_hints_fetch_pvn">#</a><code>cop_hints_fetch_pvn</code> </dt>
<dd>

<p>Look up the hint entry in the cop <code>cop</code> with the key specified by <code>keypv</code> and <code>keylen</code>. If <code>flags</code> has the <code>COPHH_KEY_UTF8</code> bit set, the key octets are interpreted as UTF-8, otherwise they are interpreted as Latin-1. <code>hash</code> is a precomputed hash of the key string, or zero if it has not been precomputed. Returns a mortal scalar copy of the value associated with the key, or <code>&amp;PL_sv_placeholder</code> if there is no value associated with the key.</p>

<ul>

<pre><code class="plaintext">SV *  cop_hints_fetch_pvn(const COP *cop, const char *keypv,
                          STRLEN keylen, U32 hash, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_fetch_pvs"><a class="permalink" href="perlapi.html#cop_hints_fetch_pvs">#</a><code>cop_hints_fetch_pvs</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_fetch_pvn">&quot;cop_hints_fetch_pvn&quot;</a>, but takes a literal string instead of a string/length pair, and no precomputed hash.</p>

<ul>

<pre><code class="plaintext">SV *  cop_hints_fetch_pvs(const COP *cop, &quot;key&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_hints_fetch_sv"><a class="permalink" href="perlapi.html#cop_hints_fetch_sv">#</a><code>cop_hints_fetch_sv</code> </dt>
<dd>

<p>Like <a href="perlapi.html#cop_hints_fetch_pvn">&quot;cop_hints_fetch_pvn&quot;</a>, but takes a Perl scalar instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV *  cop_hints_fetch_sv(const COP *cop, SV *key, U32 hash,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopLABEL"><a class="permalink" href="perlapi.html#CopLABEL">#</a><code>CopLABEL</code> </dt>
<dd>

<p>Returns the label attached to a cop.</p>

<ul>

<pre><code class="plaintext">const char *  CopLABEL(COP *const cop)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopLABEL_len"><a class="permalink" href="perlapi.html#CopLABEL_len">#</a><code>CopLABEL_len</code> </dt>
<dd>

<p>Returns the label attached to a cop, and stores its length in bytes into <code>*len</code>.</p>

<ul>

<pre><code class="plaintext">const char *  CopLABEL_len(COP *const cop, STRLEN *len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopLABEL_len_flags"><a class="permalink" href="perlapi.html#CopLABEL_len_flags">#</a><code>CopLABEL_len_flags</code> </dt>
<dd>

<p>Returns the label attached to a cop, and stores its length in bytes into <code>*len</code>. Upon return, <code>*flags</code> will be set to either <code>SVf_UTF8</code> or 0.</p>

<ul>

<pre><code class="plaintext">const char *  CopLABEL_len_flags(COP *const cop, STRLEN *len,
                                 U32 *flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopLINE"><a class="permalink" href="perlapi.html#CopLINE">#</a><code>CopLINE</code> </dt>
<dd>

<p>Returns the line number in the source code associated with the <code>COP</code> <code>c</code></p>

<ul>

<pre><code class="plaintext">STRLEN  CopLINE(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopSTASH"><a class="permalink" href="perlapi.html#CopSTASH">#</a><code>CopSTASH</code> </dt>
<dd>

<p>Returns the stash associated with <code>c</code>.</p>

<ul>

<pre><code class="plaintext">HV *  CopSTASH(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopSTASH_eq"><a class="permalink" href="perlapi.html#CopSTASH_eq">#</a><code>CopSTASH_eq</code> </dt>
<dd>

<p>Returns a boolean as to whether or not <code>hv</code> is the stash associated with <code>c</code>.</p>

<ul>

<pre><code class="plaintext">bool  CopSTASH_eq(const COP * c, const HV * hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopSTASHPV"><a class="permalink" href="perlapi.html#CopSTASHPV">#</a><code>CopSTASHPV</code> </dt>
<dd>

<p>Returns the package name of the stash associated with <code>c</code>, or <code>NULL</code> if no associated stash</p>

<ul>

<pre><code class="plaintext">char *  CopSTASHPV(const COP * c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopSTASHPV_set"><a class="permalink" href="perlapi.html#CopSTASHPV_set">#</a><code>CopSTASHPV_set</code> </dt>
<dd>

<p>Set the package name of the stash associated with <code>c</code>, to the NUL-terminated C string <code>p</code>, creating the package if necessary.</p>

<ul>

<pre><code class="plaintext">void  CopSTASHPV_set(COP * c, const char * pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopSTASH_set"><a class="permalink" href="perlapi.html#CopSTASH_set">#</a><code>CopSTASH_set</code> </dt>
<dd>

<p>Set the stash associated with <code>c</code> to <code>hv</code>.</p>

<ul>

<pre><code class="plaintext">bool  CopSTASH_set(COP * c, HV * hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cop_store_label"><a class="permalink" href="perlapi.html#cop_store_label">#</a><code>cop_store_label</code> </dt>
<dd>

<p>NOTE: <code>cop_store_label</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Save a label into a <code>cop_hints_hash</code>. You need to set flags to <code>SVf_UTF8</code> for a UTF-8 label. Any other flag is ignored.</p>

<ul>

<pre><code class="plaintext">void  cop_store_label(COP *const cop, const char *label,
                      STRLEN len, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_SI"><a class="permalink" href="perlapi.html#PERL_SI">#</a><code>PERL_SI</code> </dt>
<dd>

<p>Use this typedef to declare variables that are to hold <code>struct stackinfo</code>.</p>

</dd>
</dl>

<h1 id="Custom-Operators"><a class="permalink" href="perlapi.html#Custom-Operators">#</a><a id="Custom"></a>Custom Operators</h1>

<dl>

<dt id="custom_op_desc"><a class="permalink" href="perlapi.html#custom_op_desc">#</a><code>custom_op_desc</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>custom_op_desc</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Return the description of a given custom op. This was once used by the <code>OP_DESC</code> macro, but is no longer: it has only been kept for compatibility, and should not be used.</p>

<ul>

<pre><code class="plaintext">const char *  custom_op_desc(const OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="custom_op_name"><a class="permalink" href="perlapi.html#custom_op_name">#</a><code>custom_op_name</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>custom_op_name</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Return the name for a given custom op. This was once used by the <code>OP_NAME</code> macro, but is no longer: it has only been kept for compatibility, and should not be used.</p>

<ul>

<pre><code class="plaintext">const char *  custom_op_name(const OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="custom_op_register"><a class="permalink" href="perlapi.html#custom_op_register">#</a><code>custom_op_register</code> </dt>
<dd>

<p>Register a custom op. See <a href="perlguts.html#Custom-Operators">&quot;Custom Operators&quot; in perlguts</a>.</p>

<p>NOTE: <code>custom_op_register</code> must be explicitly called as <code>Perl_custom_op_register</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_custom_op_register(pTHX_ Perl_ppaddr_t ppaddr,
                              const XOP *xop)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_custom_op_xop"><a class="permalink" href="perlapi.html#Perl_custom_op_xop">#</a><code>Perl_custom_op_xop</code> </dt>
<dd>

<p>Return the XOP structure for a given custom op. This macro should be considered internal to <code>OP_NAME</code> and the other access macros: use them instead. This macro does call a function. Prior to 5.19.6, this was implemented as a function.</p>

<ul>

<pre><code class="plaintext">const XOP *  Perl_custom_op_xop(pTHX_ const OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopDISABLE"><a class="permalink" href="perlapi.html#XopDISABLE">#</a><code>XopDISABLE</code> </dt>
<dd>

<p>Temporarily disable a member of the XOP, by clearing the appropriate flag.</p>

<ul>

<pre><code class="plaintext">void  XopDISABLE(XOP *xop, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopENABLE"><a class="permalink" href="perlapi.html#XopENABLE">#</a><code>XopENABLE</code> </dt>
<dd>

<p>Reenable a member of the XOP which has been disabled.</p>

<ul>

<pre><code class="plaintext">void  XopENABLE(XOP *xop, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopENTRY"><a class="permalink" href="perlapi.html#XopENTRY">#</a><code>XopENTRY</code> </dt>
<dd>

<p>Return a member of the XOP structure. <code>which</code> is a cpp token indicating which entry to return. If the member is not set this will return a default value. The return type depends on <code>which</code>. This macro evaluates its arguments more than once. If you are using <code>Perl_custom_op_xop</code> to retrieve a <code>XOP *</code> from a <code>OP *</code>, use the more efficient <a href="perlapi.html#XopENTRYCUSTOM">&quot;XopENTRYCUSTOM&quot;</a> instead.</p>

<ul>

<pre><code class="plaintext">XopENTRY(XOP *xop, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopENTRYCUSTOM"><a class="permalink" href="perlapi.html#XopENTRYCUSTOM">#</a><code>XopENTRYCUSTOM</code> </dt>
<dd>

<p>Exactly like <code>XopENTRY(XopENTRY(Perl_custom_op_xop(aTHX_ o), which)</code> but more efficient. The <code>which</code> parameter is identical to <a href="perlapi.html#XopENTRY">&quot;XopENTRY&quot;</a>.</p>

<ul>

<pre><code class="plaintext">XopENTRYCUSTOM(const OP *o, which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopENTRY_set"><a class="permalink" href="perlapi.html#XopENTRY_set">#</a><code>XopENTRY_set</code> </dt>
<dd>

<p>Set a member of the XOP structure. <code>which</code> is a cpp token indicating which entry to set. See <a href="perlguts.html#Custom-Operators">&quot;Custom Operators&quot; in perlguts</a> for details about the available members and how they are used. This macro evaluates its argument more than once.</p>

<ul>

<pre><code class="plaintext">void  XopENTRY_set(XOP *xop, which, value)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XopFLAGS"><a class="permalink" href="perlapi.html#XopFLAGS">#</a><code>XopFLAGS</code> </dt>
<dd>

<p>Return the XOP&#39;s flags.</p>

<ul>

<pre><code class="plaintext">U32  XopFLAGS(XOP *xop)</code></pre>

</ul>

</dd>
</dl>

<h1 id="CV-Handling"><a class="permalink" href="perlapi.html#CV-Handling">#</a><a id="CV"></a>CV Handling</h1>

<p>This section documents functions to manipulate CVs which are code-values, meaning subroutines. For more information, see <a href="perlguts.html">perlguts</a>.</p>

<dl>

<dt id="caller_cx"><a class="permalink" href="perlapi.html#caller_cx">#</a><code>caller_cx</code> </dt>
<dd>

<p>The XSUB-writer&#39;s equivalent of <a href="perlfunc.html#caller">caller()</a>. The returned <code>PERL_CONTEXT</code> structure can be interrogated to find all the information returned to Perl by <code>caller</code>. Note that XSUBs don&#39;t get a stack frame, so <code>caller_cx(0, NULL)</code> will return information for the immediately-surrounding Perl code.</p>

<p>This function skips over the automatic calls to <code>&amp;DB::sub</code> made on the behalf of the debugger. If the stack frame requested was a sub called by <code>DB::sub</code>, the return value will be the frame for the call to <code>DB::sub</code>, since that has the correct line number/etc. for the call site. If <i>dbcxp</i> is non-<code>NULL</code>, it will be set to a pointer to the frame for the sub call itself.</p>

<ul>

<pre><code class="plaintext">const PERL_CONTEXT *  caller_cx(I32 level,
                                const PERL_CONTEXT **dbcxp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CvGV"><a class="permalink" href="perlapi.html#CvGV">#</a><code>CvGV</code> </dt>
<dd>

<p>Returns the GV associated with the CV <code>sv</code>, reifying it if necessary.</p>

<ul>

<pre><code class="plaintext">GV *  CvGV(CV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CvSTASH"><a class="permalink" href="perlapi.html#CvSTASH">#</a><code>CvSTASH</code> </dt>
<dd>

<p>Returns the stash of the CV. A stash is the symbol table hash, containing the package-scoped variables in the package where the subroutine was defined. For more information, see <a href="perlguts.html">perlguts</a>.</p>

<p>This also has a special use with XS AUTOLOAD subs. See <a href="perlguts.html#Autoloading-with-XSUBs">&quot;Autoloading with XSUBs&quot; in perlguts</a>.</p>

<ul>

<pre><code class="plaintext">HV*  CvSTASH(CV* cv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="find_runcv"><a class="permalink" href="perlapi.html#find_runcv">#</a><code>find_runcv</code> </dt>
<dd>

<p>Locate the CV corresponding to the currently executing sub or eval. If <code>db_seqp</code> is non_null, skip CVs that are in the DB package and populate <code>*db_seqp</code> with the cop sequence number at the point that the DB:: code was entered. (This allows debuggers to eval in the scope of the breakpoint rather than in the scope of the debugger itself.)</p>

<ul>

<pre><code class="plaintext">CV*  find_runcv(U32 *db_seqp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="get_cv"><a class="permalink" href="perlapi.html#get_cv">#</a><code>get_cv</code></dt>
<dd>

</dd>
<dt id="get_cvs"><a class="permalink" href="perlapi.html#get_cvs">#</a><code>get_cvs</code></dt>
<dd>

</dd>
<dt id="get_cvn_flags"><a class="permalink" href="perlapi.html#get_cvn_flags">#</a><code>get_cvn_flags</code> </dt>
<dd>

<p>These return the CV of the specified Perl subroutine. <code>flags</code> are passed to <code>gv_fetchpvn_flags</code>. If <code>GV_ADD</code> is set and the Perl subroutine does not exist then it will be declared (which has the same effect as saying <code>sub name;</code>). If <code>GV_ADD</code> is not set and the subroutine does not exist, then NULL is returned.</p>

<p>The forms differ only in how the subroutine is specified.. With <code>get_cvs</code>, the name is a literal C string, enclosed in double quotes. With <code>get_cv</code>, the name is given by the <code>name</code> parameter, which must be a NUL-terminated C string. With <code>get_cvn_flags</code>, the name is also given by the <code>name</code> parameter, but it is a Perl string (possibly containing embedded NUL bytes), and its length in bytes is contained in the <code>len</code> parameter.</p>

<p>NOTE: the <code>perl_get_cv()</code> form is <b>deprecated</b>.</p>

<p>NOTE: the <code>perl_get_cvs()</code> form is <b>deprecated</b>.</p>

<p>NOTE: the <code>perl_get_cvn_flags()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">CV*   get_cv       (const char* name, I32 flags)
CV *  get_cvs      (&quot;string&quot;, I32 flags)
CV*   get_cvn_flags(const char* name, STRLEN len, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Nullcv"><a class="permalink" href="perlapi.html#Nullcv">#</a><code>Nullcv</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>Nullcv</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Null CV pointer.</p>

<p>(deprecated - use <code>(CV *)NULL</code> instead)</p>

</dd>
</dl>

<h1 id="Debugging"><a class="permalink" href="perlapi.html#Debugging">#</a>Debugging</h1>

<dl>

<dt id="dump_all"><a class="permalink" href="perlapi.html#dump_all">#</a><code>dump_all</code> </dt>
<dd>

<p>Dumps the entire optree of the current program starting at <code>PL_main_root</code> to <code>STDERR</code>. Also dumps the optrees for all visible subroutines in <code>PL_defstash</code>.</p>

<ul>

<pre><code class="plaintext">void  dump_all()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dump_c_backtrace"><a class="permalink" href="perlapi.html#dump_c_backtrace">#</a><code>dump_c_backtrace</code> </dt>
<dd>

<p>Dumps the C backtrace to the given <code>fp</code>.</p>

<p>Returns true if a backtrace could be retrieved, false if not.</p>

<ul>

<pre><code class="plaintext">bool  dump_c_backtrace(PerlIO* fp, int max_depth, int skip)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dump_packsubs"><a class="permalink" href="perlapi.html#dump_packsubs">#</a><code>dump_packsubs</code> </dt>
<dd>

<p>Dumps the optrees for all visible subroutines in <code>stash</code>.</p>

<ul>

<pre><code class="plaintext">void  dump_packsubs(const HV* stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="get_c_backtrace_dump"><a class="permalink" href="perlapi.html#get_c_backtrace_dump">#</a><code>get_c_backtrace_dump</code> </dt>
<dd>

<p>Returns a SV containing a dump of <code>depth</code> frames of the call stack, skipping the <code>skip</code> innermost ones. <code>depth</code> of 20 is usually enough.</p>

<p>The appended output looks like:</p>

<pre><code class="plaintext">...
1   10e004812:0082   Perl_croak   util.c:1716    /usr/bin/perl
2   10df8d6d2:1d72   perl_parse   perl.c:3975    /usr/bin/perl
...</code></pre>

<p>The fields are tab-separated. The first column is the depth (zero being the innermost non-skipped frame). In the hex:offset, the hex is where the program counter was in <code>S_parse_body</code>, and the :offset (might be missing) tells how much inside the <code>S_parse_body</code> the program counter was.</p>

<p>The <code>util.c:1716</code> is the source code file and line number.</p>

<p>The <i>/usr/bin/perl</i> is obvious (hopefully).</p>

<p>Unknowns are <code>&quot;-&quot;</code>. Unknowns can happen unfortunately quite easily: if the platform doesn&#39;t support retrieving the information; if the binary is missing the debug information; if the optimizer has transformed the code by for example inlining.</p>

<ul>

<pre><code class="plaintext">SV*  get_c_backtrace_dump(int max_depth, int skip)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HAS_BACKTRACE"><a class="permalink" href="perlapi.html#HAS_BACKTRACE">#</a><code>HAS_BACKTRACE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>backtrace()</code> routine is available to get a stack trace. The <i>execinfo.h</i> header must be included to use this routine.</p>

</dd>
</dl>

<dl>

<dt id="op_class"><a class="permalink" href="perlapi.html#op_class">#</a><code>op_class</code> </dt>
<dd>

<p>Given an op, determine what type of struct it has been allocated as. Returns one of the OPclass enums, such as OPclass_LISTOP.</p>

<ul>

<pre><code class="plaintext">OPclass  op_class(const OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_dump"><a class="permalink" href="perlapi.html#op_dump">#</a><code>op_dump</code> </dt>
<dd>

<p>Dumps the optree starting at OP <code>o</code> to <code>STDERR</code>.</p>

<ul>

<pre><code class="plaintext">void  op_dump(const OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_dump"><a class="permalink" href="perlapi.html#sv_dump">#</a><code>sv_dump</code> </dt>
<dd>

<p>Dumps the contents of an SV to the <code>STDERR</code> filehandle.</p>

<p>For an example of its output, see <a href="./Devel::Peek.html">Devel::Peek</a>.</p>

<ul>

<pre><code class="plaintext">void  sv_dump(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Display-functions"><a class="permalink" href="perlapi.html#Display-functions">#</a><a id="Display"></a>Display functions</h1>

<dl>

<dt id="form"><a class="permalink" href="perlapi.html#form">#</a><code>form</code></dt>
<dd>

</dd>
<dt id="form_nocontext"><a class="permalink" href="perlapi.html#form_nocontext">#</a><code>form_nocontext</code> </dt>
<dd>

<p>These take a sprintf-style format pattern and conventional (non-SV) arguments and return the formatted string.</p>

<pre><code class="plaintext">(char *) Perl_form(pTHX_ const char* pat, ...)</code></pre>

<p>can be used any place a string (char *) is required:</p>

<pre><code>char * s = Perl_form(&quot;%d.%d&quot;,major,minor);</code></pre>

<p>They use a single (per-thread) private buffer so if you want to format several strings you must explicitly copy the earlier strings away (and free the copies when you are done).</p>

<p>The two forms differ only in that <code>form_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>NOTE: <code>form</code> must be explicitly called as <code>Perl_form</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">char*  Perl_form     (pTHX_ const char* pat, ...)
char*  form_nocontext(const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mess"><a class="permalink" href="perlapi.html#mess">#</a><code>mess</code></dt>
<dd>

</dd>
<dt id="mess_nocontext"><a class="permalink" href="perlapi.html#mess_nocontext">#</a><code>mess_nocontext</code> </dt>
<dd>

<p>These take a sprintf-style format pattern and argument list, which are used to generate a string message. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <code><a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a></code>.</p>

<p>Normally, the resulting message is returned in a new mortal SV. But during global destruction a single SV may be shared between uses of this function.</p>

<p>The two forms differ only in that <code>mess_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>NOTE: <code>mess</code> must be explicitly called as <code>Perl_mess</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">SV*  Perl_mess     (pTHX_ const char* pat, ...)
SV*  mess_nocontext(const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mess_sv"><a class="permalink" href="perlapi.html#mess_sv">#</a><code>mess_sv</code> </dt>
<dd>

<p>Expands a message, intended for the user, to include an indication of the current location in the code, if the message does not already appear to be complete.</p>

<p><code>basemsg</code> is the initial message or object. If it is a reference, it will be used as-is and will be the result of this function. Otherwise it is used as a string, and if it already ends with a newline, it is taken to be complete, and the result of this function will be the same string. If the message does not end with a newline, then a segment such as <code>at foo.pl line 37</code> will be appended, and possibly other clauses indicating the current state of execution. The resulting message will end with a dot and a newline.</p>

<p>Normally, the resulting message is returned in a new mortal SV. During global destruction a single SV may be shared between uses of this function. If <code>consume</code> is true, then the function is permitted (but not required) to modify and return <code>basemsg</code> instead of allocating a new SV.</p>

<ul>

<pre><code class="plaintext">SV*  mess_sv(SV* basemsg, bool consume)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pv_display"><a class="permalink" href="perlapi.html#pv_display">#</a><code>pv_display</code> </dt>
<dd>

<p>Similar to</p>

<pre><code>pv_escape(dsv,pv,cur,pvlim,PERL_PV_ESCAPE_QUOTE);</code></pre>

<p>except that an additional &quot;\0&quot; will be appended to the string when len &gt; cur and pv[cur] is &quot;\0&quot;.</p>

<p>Note that the final string may be up to 7 chars longer than pvlim.</p>

<ul>

<pre><code class="plaintext">char*  pv_display(SV *dsv, const char *pv, STRLEN cur, STRLEN len,
                  STRLEN pvlim)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pv_escape"><a class="permalink" href="perlapi.html#pv_escape">#</a><code>pv_escape</code> </dt>
<dd>

<p>Escapes at most the first <code>count</code> chars of <code>pv</code> and puts the results into <code>dsv</code> such that the size of the escaped string will not exceed <code>max</code> chars and will not contain any incomplete escape sequences. The number of bytes escaped will be returned in the <code>STRLEN *escaped</code> parameter if it is not null. When the <code>dsv</code> parameter is null no escaping actually occurs, but the number of bytes that would be escaped were it not null will be calculated.</p>

<p>If flags contains <code>PERL_PV_ESCAPE_QUOTE</code> then any double quotes in the string will also be escaped.</p>

<p>Normally the SV will be cleared before the escaped string is prepared, but when <code>PERL_PV_ESCAPE_NOCLEAR</code> is set this will not occur.</p>

<p>If <code>PERL_PV_ESCAPE_UNI</code> is set then the input string is treated as UTF-8 if <code>PERL_PV_ESCAPE_UNI_DETECT</code> is set then the input string is scanned using <code>is_utf8_string()</code> to determine if it is UTF-8.</p>

<p>If <code>PERL_PV_ESCAPE_ALL</code> is set then all input chars will be output using <code>\x01F1</code> style escapes, otherwise if <code>PERL_PV_ESCAPE_NONASCII</code> is set, only non-ASCII chars will be escaped using this style; otherwise, only chars above 255 will be so escaped; other non printable chars will use octal or common escaped patterns like <code>\n</code>. Otherwise, if <code>PERL_PV_ESCAPE_NOBACKSLASH</code> then all chars below 255 will be treated as printable and will be output as literals.</p>

<p>If <code>PERL_PV_ESCAPE_FIRSTCHAR</code> is set then only the first char of the string will be escaped, regardless of max. If the output is to be in hex, then it will be returned as a plain hex sequence. Thus the output will either be a single char, an octal escape sequence, a special escape like <code>\n</code> or a hex value.</p>

<p>If <code>PERL_PV_ESCAPE_RE</code> is set then the escape char used will be a <code>&quot;%&quot;</code> and not a <code>&quot;\\&quot;</code>. This is because regexes very often contain backslashed sequences, whereas <code>&quot;%&quot;</code> is not a particularly common character in patterns.</p>

<p>Returns a pointer to the escaped text as held by <code>dsv</code>.</p>

<ul>

<pre><code class="plaintext">char*  pv_escape(SV *dsv, char const * const str,
                 const STRLEN count, const STRLEN max,
                 STRLEN * const escaped, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pv_pretty"><a class="permalink" href="perlapi.html#pv_pretty">#</a><code>pv_pretty</code> </dt>
<dd>

<p>Converts a string into something presentable, handling escaping via <code>pv_escape()</code> and supporting quoting and ellipses.</p>

<p>If the <code>PERL_PV_PRETTY_QUOTE</code> flag is set then the result will be double quoted with any double quotes in the string escaped. Otherwise if the <code>PERL_PV_PRETTY_LTGT</code> flag is set then the result be wrapped in angle brackets.</p>

<p>If the <code>PERL_PV_PRETTY_ELLIPSES</code> flag is set and not all characters in string were output then an ellipsis <code>...</code> will be appended to the string. Note that this happens AFTER it has been quoted.</p>

<p>If <code>start_color</code> is non-null then it will be inserted after the opening quote (if there is one) but before the escaped text. If <code>end_color</code> is non-null then it will be inserted after the escaped text but before any quotes or ellipses.</p>

<p>Returns a pointer to the prettified text as held by <code>dsv</code>.</p>

<ul>

<pre><code class="plaintext">char*  pv_pretty(SV *dsv, char const * const str,
                 const STRLEN count, const STRLEN max,
                 char const * const start_color,
                 char const * const end_color, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vform"><a class="permalink" href="perlapi.html#vform">#</a><code>vform</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#form">&quot;form&quot;</a></code> but but the arguments are an encapsulated argument list.</p>

<ul>

<pre><code class="plaintext">char*  vform(const char* pat, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vmess"><a class="permalink" href="perlapi.html#vmess">#</a><code>vmess</code> </dt>
<dd>

<p><code>pat</code> and <code>args</code> are a sprintf-style format pattern and encapsulated argument list, respectively. These are used to generate a string message. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a>.</p>

<p>Normally, the resulting message is returned in a new mortal SV. During global destruction a single SV may be shared between uses of this function.</p>

<ul>

<pre><code class="plaintext">SV*  vmess(const char* pat, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Embedding-and-Interpreter-Cloning"><a class="permalink" href="perlapi.html#Embedding-and-Interpreter-Cloning">#</a><a id="Embedding"></a>Embedding and Interpreter Cloning</h1>

<dl>

<dt id="cv_clone"><a class="permalink" href="perlapi.html#cv_clone">#</a><code>cv_clone</code> </dt>
<dd>

<p>Clone a CV, making a lexical closure. <code>proto</code> supplies the prototype of the function: its code, pad structure, and other attributes. The prototype is combined with a capture of outer lexicals to which the code refers, which are taken from the currently-executing instance of the immediately surrounding code.</p>

<ul>

<pre><code class="plaintext">CV*  cv_clone(CV* proto)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_name"><a class="permalink" href="perlapi.html#cv_name">#</a><code>cv_name</code> </dt>
<dd>

<p>Returns an SV containing the name of the CV, mainly for use in error reporting. The CV may actually be a GV instead, in which case the returned SV holds the GV&#39;s name. Anything other than a GV or CV is treated as a string already holding the sub name, but this could change in the future.</p>

<p>An SV may be passed as a second argument. If so, the name will be assigned to it and it will be returned. Otherwise the returned SV will be a new mortal.</p>

<p>If <code>flags</code> has the <code>CV_NAME_NOTQUAL</code> bit set, then the package name will not be included. If the first argument is neither a CV nor a GV, this flag is ignored (subject to change).</p>

<ul>

<pre><code class="plaintext">SV *  cv_name(CV *cv, SV *sv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_undef"><a class="permalink" href="perlapi.html#cv_undef">#</a><code>cv_undef</code> </dt>
<dd>

<p>Clear out all the active components of a CV. This can happen either by an explicit <code>undef &amp;foo</code>, or by the reference count going to zero. In the former case, we keep the <code>CvOUTSIDE</code> pointer, so that any anonymous children can still follow the full lexical scope chain.</p>

<ul>

<pre><code class="plaintext">void  cv_undef(CV* cv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="find_rundefsv"><a class="permalink" href="perlapi.html#find_rundefsv">#</a><code>find_rundefsv</code> </dt>
<dd>

<p>Returns the global variable <code>$_</code>.</p>

<ul>

<pre><code class="plaintext">SV*  find_rundefsv()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="find_rundefsvoffset"><a class="permalink" href="perlapi.html#find_rundefsvoffset">#</a><code>find_rundefsvoffset</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>find_rundefsvoffset</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Until the lexical <code>$_</code> feature was removed, this function would find the position of the lexical <code>$_</code> in the pad of the currently-executing function and return the offset in the current pad, or <code>NOT_IN_PAD</code>.</p>

<p>Now it always returns <code>NOT_IN_PAD</code>.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  find_rundefsvoffset()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="intro_my"><a class="permalink" href="perlapi.html#intro_my">#</a><code>intro_my</code> </dt>
<dd>

<p>&quot;Introduce&quot; <code>my</code> variables to visible status. This is called during parsing at the end of each statement to make lexical variables visible to subsequent statements.</p>

<ul>

<pre><code class="plaintext">U32  intro_my()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="load_module"><a class="permalink" href="perlapi.html#load_module">#</a><code>load_module</code> </dt>
<dd>

<p>Loads the module whose name is pointed to by the string part of <code>name</code>. Note that the actual module name, not its filename, should be given. Eg, &quot;Foo::Bar&quot; instead of &quot;Foo/Bar.pm&quot;. ver, if specified and not NULL, provides version semantics similar to <code>use Foo::Bar VERSION</code>. The optional trailing arguments can be used to specify arguments to the module&#39;s <code>import()</code> method, similar to <code>use Foo::Bar VERSION LIST</code>; their precise handling depends on the flags. The flags argument is a bitwise-ORed collection of any of <code>PERL_LOADMOD_DENY</code>, <code>PERL_LOADMOD_NOIMPORT</code>, or <code>PERL_LOADMOD_IMPORT_OPS</code> (or 0 for no flags).</p>

<p>If <code>PERL_LOADMOD_NOIMPORT</code> is set, the module is loaded as if with an empty import list, as in <code>use Foo::Bar ()</code>; this is the only circumstance in which the trailing optional arguments may be omitted entirely. Otherwise, if <code>PERL_LOADMOD_IMPORT_OPS</code> is set, the trailing arguments must consist of exactly one <code>OP*</code>, containing the op tree that produces the relevant import arguments. Otherwise, the trailing arguments must all be <code>SV*</code> values that will be used as import arguments; and the list must be terminated with <code>(SV*) NULL</code>. If neither <code>PERL_LOADMOD_NOIMPORT</code> nor <code>PERL_LOADMOD_IMPORT_OPS</code> is set, the trailing <code>NULL</code> pointer is needed even if no import arguments are desired. The reference count for each specified <code>SV*</code> argument is decremented. In addition, the <code>name</code> argument is modified.</p>

<p>If <code>PERL_LOADMOD_DENY</code> is set, the module is loaded as if with <code>no</code> rather than <code>use</code>.</p>

<ul>

<pre><code class="plaintext">void  load_module(U32 flags, SV* name, SV* ver, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="load_module_nocontext"><a class="permalink" href="perlapi.html#load_module_nocontext">#</a><code>load_module_nocontext</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#load_module">&quot;load_module&quot;</a></code> but does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<ul>

<pre><code class="plaintext">void  load_module_nocontext(U32 flags, SV* name, SV* ver, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_exit"><a class="permalink" href="perlapi.html#my_exit">#</a><code>my_exit</code> </dt>
<dd>

<p>A wrapper for the C library <a href="http://man.he.net/man3/exit">exit(3)</a>, honoring what <a href="perlapi.html#PL_exit_flags">&quot;PL_exit_flags&quot; in perlapi</a> say to do.</p>

<ul>

<pre><code class="plaintext">void  my_exit(U32 status)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPADNAMELIST"><a class="permalink" href="perlapi.html#newPADNAMELIST">#</a><code>newPADNAMELIST</code> </dt>
<dd>

<p>NOTE: <code>newPADNAMELIST</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Creates a new pad name list. <code>max</code> is the highest index for which space is allocated.</p>

<ul>

<pre><code class="plaintext">PADNAMELIST *  newPADNAMELIST(size_t max)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPADNAMEouter"><a class="permalink" href="perlapi.html#newPADNAMEouter">#</a><code>newPADNAMEouter</code> </dt>
<dd>

<p>NOTE: <code>newPADNAMEouter</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Constructs and returns a new pad name. Only use this function for names that refer to outer lexicals. (See also <a href="perlapi.html#newPADNAMEpvn">&quot;newPADNAMEpvn&quot;</a>.) <code>outer</code> is the outer pad name that this one mirrors. The returned pad name has the <code>PADNAMEt_OUTER</code> flag already set.</p>

<ul>

<pre><code class="plaintext">PADNAME *  newPADNAMEouter(PADNAME *outer)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPADNAMEpvn"><a class="permalink" href="perlapi.html#newPADNAMEpvn">#</a><code>newPADNAMEpvn</code> </dt>
<dd>

<p>NOTE: <code>newPADNAMEpvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Constructs and returns a new pad name. <code>s</code> must be a UTF-8 string. Do not use this for pad names that point to outer lexicals. See <code><a href="perlapi.html#newPADNAMEouter">&quot;newPADNAMEouter&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">PADNAME *  newPADNAMEpvn(const char *s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="nothreadhook"><a class="permalink" href="perlapi.html#nothreadhook">#</a><code>nothreadhook</code> </dt>
<dd>

<p>Stub that provides thread hook for perl_destruct when there are no threads.</p>

<ul>

<pre><code class="plaintext">int  nothreadhook()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_add_anon"><a class="permalink" href="perlapi.html#pad_add_anon">#</a><code>pad_add_anon</code> </dt>
<dd>

<p>Allocates a place in the currently-compiling pad (via <a href="perlapi.html#pad_alloc">&quot;pad_alloc&quot;</a>) for an anonymous function that is lexically scoped inside the currently-compiling function. The function <code>func</code> is linked into the pad, and its <code>CvOUTSIDE</code> link to the outer scope is weakened to avoid a reference loop.</p>

<p>One reference count is stolen, so you may need to do <code>SvREFCNT_inc(func)</code>.</p>

<p><code>optype</code> should be an opcode indicating the type of operation that the pad entry is to support. This doesn&#39;t affect operational semantics, but is used for debugging.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_add_anon(CV* func, I32 optype)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_add_name_pv"><a class="permalink" href="perlapi.html#pad_add_name_pv">#</a><code>pad_add_name_pv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_add_name_pvn">&quot;pad_add_name_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_add_name_pv(const char *name, const U32 flags,
                           HV *typestash, HV *ourstash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_add_name_pvn"><a class="permalink" href="perlapi.html#pad_add_name_pvn">#</a><code>pad_add_name_pvn</code> </dt>
<dd>

<p>Allocates a place in the currently-compiling pad for a named lexical variable. Stores the name and other metadata in the name part of the pad, and makes preparations to manage the variable&#39;s lexical scoping. Returns the offset of the allocated pad slot.</p>

<p><code>namepv</code>/<code>namelen</code> specify the variable&#39;s name, including leading sigil. If <code>typestash</code> is non-null, the name is for a typed lexical, and this identifies the type. If <code>ourstash</code> is non-null, it&#39;s a lexical reference to a package variable, and this identifies the package. The following flags can be OR&#39;ed together:</p>

<pre><code class="plaintext">padadd_OUR          redundantly specifies if it&#39;s a package var
padadd_STATE        variable will retain value persistently
padadd_NO_DUP_CHECK skip check for lexical shadowing</code></pre>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_add_name_pvn(const char *namepv, STRLEN namelen,
                            U32 flags, HV *typestash,
                            HV *ourstash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_add_name_sv"><a class="permalink" href="perlapi.html#pad_add_name_sv">#</a><code>pad_add_name_sv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_add_name_pvn">&quot;pad_add_name_pvn&quot;</a>, but takes the name string in the form of an SV instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_add_name_sv(SV *name, U32 flags, HV *typestash,
                           HV *ourstash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_alloc"><a class="permalink" href="perlapi.html#pad_alloc">#</a><code>pad_alloc</code> </dt>
<dd>

<p>NOTE: <code>pad_alloc</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Allocates a place in the currently-compiling pad, returning the offset of the allocated pad slot. No name is initially attached to the pad slot. <code>tmptype</code> is a set of flags indicating the kind of pad entry required, which will be set in the value SV for the allocated pad entry:</p>

<pre><code class="plaintext">SVs_PADMY    named lexical variable (&quot;my&quot;, &quot;our&quot;, &quot;state&quot;)
SVs_PADTMP   unnamed temporary store
SVf_READONLY constant shared between recursion levels</code></pre>

<p><code>SVf_READONLY</code> has been supported here only since perl 5.20. To work with earlier versions as well, use <code>SVf_READONLY|SVs_PADTMP</code>. <code>SVf_READONLY</code> does not cause the SV in the pad slot to be marked read-only, but simply tells <code>pad_alloc</code> that it <i>will</i> be made read-only (by the caller), or at least should be treated as such.</p>

<p><code>optype</code> should be an opcode indicating the type of operation that the pad entry is to support. This doesn&#39;t affect operational semantics, but is used for debugging.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_alloc(I32 optype, U32 tmptype)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_findmy_pv"><a class="permalink" href="perlapi.html#pad_findmy_pv">#</a><code>pad_findmy_pv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_findmy_pvn">&quot;pad_findmy_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_findmy_pv(const char* name, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_findmy_pvn"><a class="permalink" href="perlapi.html#pad_findmy_pvn">#</a><code>pad_findmy_pvn</code> </dt>
<dd>

<p>Given the name of a lexical variable, find its position in the currently-compiling pad. <code>namepv</code>/<code>namelen</code> specify the variable&#39;s name, including leading sigil. <code>flags</code> is reserved and must be zero. If it is not in the current pad but appears in the pad of any lexically enclosing scope, then a pseudo-entry for it is added in the current pad. Returns the offset in the current pad, or <code>NOT_IN_PAD</code> if no such lexical is in scope.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_findmy_pvn(const char* namepv, STRLEN namelen,
                          U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_findmy_sv"><a class="permalink" href="perlapi.html#pad_findmy_sv">#</a><code>pad_findmy_sv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_findmy_pvn">&quot;pad_findmy_pvn&quot;</a>, but takes the name string in the form of an SV instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_findmy_sv(SV* name, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="padnamelist_fetch"><a class="permalink" href="perlapi.html#padnamelist_fetch">#</a><code>padnamelist_fetch</code> </dt>
<dd>

<p>NOTE: <code>padnamelist_fetch</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Fetches the pad name from the given index.</p>

<ul>

<pre><code class="plaintext">PADNAME *  padnamelist_fetch(PADNAMELIST *pnl, SSize_t key)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="padnamelist_store"><a class="permalink" href="perlapi.html#padnamelist_store">#</a><code>padnamelist_store</code> </dt>
<dd>

<p>NOTE: <code>padnamelist_store</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Stores the pad name (which may be null) at the given index, freeing any existing pad name in that slot.</p>

<ul>

<pre><code class="plaintext">PADNAME **  padnamelist_store(PADNAMELIST *pnl, SSize_t key,
                              PADNAME *val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_tidy"><a class="permalink" href="perlapi.html#pad_tidy">#</a><code>pad_tidy</code> </dt>
<dd>

<p>NOTE: <code>pad_tidy</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Tidy up a pad at the end of compilation of the code to which it belongs. Jobs performed here are: remove most stuff from the pads of anonsub prototypes; give it a <code>@_</code>; mark temporaries as such. <code>type</code> indicates the kind of subroutine:</p>

<pre><code class="plaintext">padtidy_SUB        ordinary subroutine
padtidy_SUBCLONE   prototype for lexical closure
padtidy_FORMAT     format</code></pre>

<ul>

<pre><code class="plaintext">void  pad_tidy(padtidy_type type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_alloc"><a class="permalink" href="perlapi.html#perl_alloc">#</a><code>perl_alloc</code> </dt>
<dd>

<p>Allocates a new Perl interpreter. See <a href="perlembed.html">perlembed</a>.</p>

<ul>

<pre><code class="plaintext">PerlInterpreter*  perl_alloc()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_ASYNC_CHECK"><a class="permalink" href="perlapi.html#PERL_ASYNC_CHECK">#</a><code>PERL_ASYNC_CHECK</code></dt>
<dd>

<p>Described in <a href="perlinterp.html">perlinterp</a>.</p>

<ul>

<pre><code class="plaintext">void  PERL_ASYNC_CHECK()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_clone"><a class="permalink" href="perlapi.html#perl_clone">#</a><code>perl_clone</code> </dt>
<dd>

<p>Create and return a new interpreter by cloning the current one.</p>

<p><code>perl_clone</code> takes these flags as parameters:</p>

<p><code>CLONEf_COPY_STACKS</code> - is used to, well, copy the stacks also, without it we only clone the data and zero the stacks, with it we copy the stacks and the new perl interpreter is ready to run at the exact same point as the previous one. The pseudo-fork code uses <code>COPY_STACKS</code> while the threads-&gt;create doesn&#39;t.</p>

<p><code>CLONEf_KEEP_PTR_TABLE</code> - <code>perl_clone</code> keeps a ptr_table with the pointer of the old variable as a key and the new variable as a value, this allows it to check if something has been cloned and not clone it again, but rather just use the value and increase the refcount. If <code>KEEP_PTR_TABLE</code> is not set then <code>perl_clone</code> will kill the ptr_table using the function <span style="white-space: nowrap;"><code>ptr_table_free(PL_ptr_table); PL_ptr_table = NULL;</code></span>. A reason to keep it around is if you want to dup some of your own variables which are outside the graph that perl scans.</p>

<p><code>CLONEf_CLONE_HOST</code> - This is a win32 thing, it is ignored on unix, it tells perl&#39;s win32host code (which is c++) to clone itself, this is needed on win32 if you want to run two threads at the same time, if you just want to do some stuff in a separate perl interpreter and then throw it away and return to the original one, you don&#39;t need to do anything.</p>

<ul>

<pre><code class="plaintext">PerlInterpreter*  perl_clone(PerlInterpreter *proto_perl,
                             UV flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_construct"><a class="permalink" href="perlapi.html#perl_construct">#</a><code>perl_construct</code> </dt>
<dd>

<p>Initializes a new Perl interpreter. See <a href="perlembed.html">perlembed</a>.</p>

<ul>

<pre><code class="plaintext">void  perl_construct(PerlInterpreter *my_perl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_destruct"><a class="permalink" href="perlapi.html#perl_destruct">#</a><code>perl_destruct</code> </dt>
<dd>

<p>Shuts down a Perl interpreter. See <a href="perlembed.html">perlembed</a> for a tutorial.</p>

<p><code>my_perl</code> points to the Perl interpreter. It must have been previously created through the use of <a href="perlapi.html#perl_alloc">&quot;perl_alloc&quot;</a> and <a href="perlapi.html#perl_construct">&quot;perl_construct&quot;</a>. It may have been initialised through <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a>, and may have been used through <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a> and other means. This function should be called for any Perl interpreter that has been constructed with <a href="perlapi.html#perl_construct">&quot;perl_construct&quot;</a>, even if subsequent operations on it failed, for example if <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a> returned a non-zero value.</p>

<p>If the interpreter&#39;s <code>PL_exit_flags</code> word has the <code>PERL_EXIT_DESTRUCT_END</code> flag set, then this function will execute code in <code>END</code> blocks before performing the rest of destruction. If it is desired to make any use of the interpreter between <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a> and <a href="perlapi.html#perl_destruct">&quot;perl_destruct&quot;</a> other than just calling <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a>, then this flag should be set early on. This matters if <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a> will not be called, or if anything else will be done in addition to calling <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a>.</p>

<p>Returns a value be a suitable value to pass to the C library function <code>exit</code> (or to return from <code>main</code>), to serve as an exit code indicating the nature of the way the interpreter terminated. This takes into account any failure of <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a> and any early exit from <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a>. The exit code is of the type required by the host operating system, so because of differing exit code conventions it is not portable to interpret specific numeric values as having specific meanings.</p>

<ul>

<pre><code class="plaintext">int  perl_destruct(PerlInterpreter *my_perl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_free"><a class="permalink" href="perlapi.html#perl_free">#</a><code>perl_free</code> </dt>
<dd>

<p>Releases a Perl interpreter. See <a href="perlembed.html">perlembed</a>.</p>

<ul>

<pre><code class="plaintext">void  perl_free(PerlInterpreter *my_perl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_parse"><a class="permalink" href="perlapi.html#perl_parse">#</a><code>perl_parse</code> </dt>
<dd>

<p>Tells a Perl interpreter to parse a Perl script. This performs most of the initialisation of a Perl interpreter. See <a href="perlembed.html">perlembed</a> for a tutorial.</p>

<p><code>my_perl</code> points to the Perl interpreter that is to parse the script. It must have been previously created through the use of <a href="perlapi.html#perl_alloc">&quot;perl_alloc&quot;</a> and <a href="perlapi.html#perl_construct">&quot;perl_construct&quot;</a>. <code>xsinit</code> points to a callback function that will be called to set up the ability for this Perl interpreter to load XS extensions, or may be null to perform no such setup.</p>

<p><code>argc</code> and <code>argv</code> supply a set of command-line arguments to the Perl interpreter, as would normally be passed to the <code>main</code> function of a C program. <code>argv[argc]</code> must be null. These arguments are where the script to parse is specified, either by naming a script file or by providing a script in a <code>-e</code> option. If <a href="perlvar.html#%240"><code>$0</code></a> will be written to in the Perl interpreter, then the argument strings must be in writable memory, and so mustn&#39;t just be string constants.</p>

<p><code>env</code> specifies a set of environment variables that will be used by this Perl interpreter. If non-null, it must point to a null-terminated array of environment strings. If null, the Perl interpreter will use the environment supplied by the <code>environ</code> global variable.</p>

<p>This function initialises the interpreter, and parses and compiles the script specified by the command-line arguments. This includes executing code in <code>BEGIN</code>, <code>UNITCHECK</code>, and <code>CHECK</code> blocks. It does not execute <code>INIT</code> blocks or the main program.</p>

<p>Returns an integer of slightly tricky interpretation. The correct use of the return value is as a truth value indicating whether there was a failure in initialisation. If zero is returned, this indicates that initialisation was successful, and it is safe to proceed to call <a href="perlapi.html#perl_run">&quot;perl_run&quot;</a> and make other use of it. If a non-zero value is returned, this indicates some problem that means the interpreter wants to terminate. The interpreter should not be just abandoned upon such failure; the caller should proceed to shut the interpreter down cleanly with <a href="perlapi.html#perl_destruct">&quot;perl_destruct&quot;</a> and free it with <a href="perlapi.html#perl_free">&quot;perl_free&quot;</a>.</p>

<p>For historical reasons, the non-zero return value also attempts to be a suitable value to pass to the C library function <code>exit</code> (or to return from <code>main</code>), to serve as an exit code indicating the nature of the way initialisation terminated. However, this isn&#39;t portable, due to differing exit code conventions. A historical bug is preserved for the time being: if the Perl built-in <code>exit</code> is called during this function&#39;s execution, with a type of exit entailing a zero exit code under the host operating system&#39;s conventions, then this function returns zero rather than a non-zero value. This bug, [perl #2754], leads to <code>perl_run</code> being called (and therefore <code>INIT</code> blocks and the main program running) despite a call to <code>exit</code>. It has been preserved because a popular module-installing module has come to rely on it and needs time to be fixed. This issue is [perl #132577], and the original bug is due to be fixed in Perl 5.30.</p>

<ul>

<pre><code class="plaintext">int  perl_parse(PerlInterpreter *my_perl, XSINIT_t xsinit,
                int argc, char** argv, char** env)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="perl_run"><a class="permalink" href="perlapi.html#perl_run">#</a><code>perl_run</code> </dt>
<dd>

<p>Tells a Perl interpreter to run its main program. See <a href="perlembed.html">perlembed</a> for a tutorial.</p>

<p><code>my_perl</code> points to the Perl interpreter. It must have been previously created through the use of <a href="perlapi.html#perl_alloc">&quot;perl_alloc&quot;</a> and <a href="perlapi.html#perl_construct">&quot;perl_construct&quot;</a>, and initialised through <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a>. This function should not be called if <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a> returned a non-zero value, indicating a failure in initialisation or compilation.</p>

<p>This function executes code in <code>INIT</code> blocks, and then executes the main program. The code to be executed is that established by the prior call to <a href="perlapi.html#perl_parse">&quot;perl_parse&quot;</a>. If the interpreter&#39;s <code>PL_exit_flags</code> word does not have the <code>PERL_EXIT_DESTRUCT_END</code> flag set, then this function will also execute code in <code>END</code> blocks. If it is desired to make any further use of the interpreter after calling this function, then <code>END</code> blocks should be postponed to <a href="perlapi.html#perl_destruct">&quot;perl_destruct&quot;</a> time by setting that flag.</p>

<p>Returns an integer of slightly tricky interpretation. The correct use of the return value is as a truth value indicating whether the program terminated non-locally. If zero is returned, this indicates that the program ran to completion, and it is safe to make other use of the interpreter (provided that the <code>PERL_EXIT_DESTRUCT_END</code> flag was set as described above). If a non-zero value is returned, this indicates that the interpreter wants to terminate early. The interpreter should not be just abandoned because of this desire to terminate; the caller should proceed to shut the interpreter down cleanly with <a href="perlapi.html#perl_destruct">&quot;perl_destruct&quot;</a> and free it with <a href="perlapi.html#perl_free">&quot;perl_free&quot;</a>.</p>

<p>For historical reasons, the non-zero return value also attempts to be a suitable value to pass to the C library function <code>exit</code> (or to return from <code>main</code>), to serve as an exit code indicating the nature of the way the program terminated. However, this isn&#39;t portable, due to differing exit code conventions. An attempt is made to return an exit code of the type required by the host operating system, but because it is constrained to be non-zero, it is not necessarily possible to indicate every type of exit. It is only reliable on Unix, where a zero exit code can be augmented with a set bit that will be ignored. In any case, this function is not the correct place to acquire an exit code: one should get that from <a href="perlapi.html#perl_destruct">&quot;perl_destruct&quot;</a>.</p>

<ul>

<pre><code class="plaintext">int  perl_run(PerlInterpreter *my_perl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_SYS_INIT"><a class="permalink" href="perlapi.html#PERL_SYS_INIT">#</a><code>PERL_SYS_INIT</code> </dt>
<dd>

<p>Provides system-specific tune up of the C runtime environment necessary to run Perl interpreters. This should be called only once, before creating any Perl interpreters.</p>

<ul>

<pre><code class="plaintext">void  PERL_SYS_INIT(int *argc, char*** argv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_SYS_INIT3"><a class="permalink" href="perlapi.html#PERL_SYS_INIT3">#</a><code>PERL_SYS_INIT3</code> </dt>
<dd>

<p>Provides system-specific tune up of the C runtime environment necessary to run Perl interpreters. This should be called only once, before creating any Perl interpreters.</p>

<ul>

<pre><code class="plaintext">void  PERL_SYS_INIT3(int *argc, char*** argv, char*** env)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_SYS_TERM"><a class="permalink" href="perlapi.html#PERL_SYS_TERM">#</a><code>PERL_SYS_TERM</code> </dt>
<dd>

<p>Provides system-specific clean up of the C runtime environment after running Perl interpreters. This should be called only once, after freeing any remaining Perl interpreters.</p>

<ul>

<pre><code class="plaintext">void  PERL_SYS_TERM()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_exit_flags"><a class="permalink" href="perlapi.html#PL_exit_flags">#</a><code>PL_exit_flags</code> </dt>
<dd>

<p>Contains flags controlling perl&#39;s behaviour on exit():</p>

<ul>

<li><p><code>PERL_EXIT_DESTRUCT_END</code></p>

<p>If set, END blocks are executed when the interpreter is destroyed. This is normally set by perl itself after the interpreter is constructed.</p>

</li>
<li><p><code>PERL_EXIT_ABORT</code></p>

<p>Call <code>abort()</code> on exit. This is used internally by perl itself to abort if exit is called while processing exit.</p>

</li>
<li><p><code>PERL_EXIT_WARN</code></p>

<p>Warn on exit.</p>

</li>
<li><p><code>PERL_EXIT_EXPECTED</code></p>

<p>Set by the <a href="perlfunc.html#exit">&quot;exit&quot; in perlfunc</a> operator.</p>

</li>
</ul>

<ul>

<pre><code class="plaintext">U8  PL_exit_flags</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_perl_destruct_level"><a class="permalink" href="perlapi.html#PL_perl_destruct_level">#</a><code>PL_perl_destruct_level</code> </dt>
<dd>

<p>This value may be set when embedding for full cleanup.</p>

<p>Possible values:</p>

<ul>

<li><p>0 - none</p>

</li>
<li><p>1 - full</p>

</li>
<li><p>2 or greater - full with checks.</p>

</li>
</ul>

<p>If <code>$ENV{PERL_DESTRUCT_LEVEL}</code> is set to an integer greater than the value of <code>PL_perl_destruct_level</code> its value is used instead.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">signed char  PL_perl_destruct_level</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="require_pv"><a class="permalink" href="perlapi.html#require_pv">#</a><code>require_pv</code> </dt>
<dd>

<p>Tells Perl to <code>require</code> the file named by the string argument. It is analogous to the Perl code <code>eval &quot;require &#39;$file&#39;&quot;</code>. It&#39;s even implemented that way; consider using load_module instead.</p>

<p>NOTE: the <code>perl_require_pv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">void  require_pv(const char* pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UVf"><a class="permalink" href="perlapi.html#UVf">#</a><code>UVf</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>UVf</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Obsolete form of <code>UVuf</code>, which you should convert to instead use</p>

<ul>

<pre><code class="plaintext">const char *  UVf</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vload_module"><a class="permalink" href="perlapi.html#vload_module">#</a><code>vload_module</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#load_module">&quot;load_module&quot;</a></code> but the arguments are an encapsulated argument list.</p>

<ul>

<pre><code class="plaintext">void  vload_module(U32 flags, SV* name, SV* ver, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Errno"><a class="permalink" href="perlapi.html#Errno">#</a>Errno</h1>

<dl>

<dt id="sv_string_from_errnum"><a class="permalink" href="perlapi.html#sv_string_from_errnum">#</a><code>sv_string_from_errnum</code> </dt>
<dd>

<p>Generates the message string describing an OS error and returns it as an SV. <code>errnum</code> must be a value that <code>errno</code> could take, identifying the type of error.</p>

<p>If <code>tgtsv</code> is non-null then the string will be written into that SV (overwriting existing content) and it will be returned. If <code>tgtsv</code> is a null pointer then the string will be written into a new mortal SV which will be returned.</p>

<p>The message will be taken from whatever locale would be used by <code>$!</code>, and will be encoded in the SV in whatever manner would be used by <code>$!</code>. The details of this process are subject to future change. Currently, the message is taken from the C locale by default (usually producing an English message), and from the currently selected locale when in the scope of the <code>use locale</code> pragma. A heuristic attempt is made to decode the message from the locale&#39;s character encoding, but it will only be decoded as either UTF-8 or ISO-8859-1. It is always correctly decoded in a UTF-8 locale, usually in an ISO-8859-1 locale, and never in any other locale.</p>

<p>The SV is always returned containing an actual string, and with no other OK bits set. Unlike <code>$!</code>, a message is even yielded for <code>errnum</code> zero (meaning success), and if no useful message is available then a useless string (currently empty) is returned.</p>

<ul>

<pre><code class="plaintext">SV*  sv_string_from_errnum(int errnum, SV* tgtsv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Exception-Handling-(simple)-Macros"><a class="permalink" href="perlapi.html#Exception-Handling-(simple)-Macros">#</a><a id="Exception"></a><a id="Exception-Handling-simple-Macros1"></a>Exception Handling (simple) Macros</h1>

<dl>

<dt id="dXCPT"><a class="permalink" href="perlapi.html#dXCPT">#</a><code>dXCPT</code> </dt>
<dd>

<p>Set up necessary local variables for exception handling. See <a href="perlguts.html#Exception-Handling">&quot;Exception Handling&quot; in perlguts</a>.</p>

<ul>

<pre><code>dXCPT;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="JMPENV_JUMP"><a class="permalink" href="perlapi.html#JMPENV_JUMP">#</a><code>JMPENV_JUMP</code></dt>
<dd>

<p>Described in <a href="perlinterp.html">perlinterp</a>.</p>

<ul>

<pre><code class="plaintext">void  JMPENV_JUMP(int v)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="JMPENV_PUSH"><a class="permalink" href="perlapi.html#JMPENV_PUSH">#</a><code>JMPENV_PUSH</code></dt>
<dd>

<p>Described in <a href="perlinterp.html">perlinterp</a>.</p>

<ul>

<pre><code class="plaintext">void  JMPENV_PUSH(int v)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_restartop"><a class="permalink" href="perlapi.html#PL_restartop">#</a><code>PL_restartop</code></dt>
<dd>

<p>Described in <a href="perlinterp.html">perlinterp</a>.</p>

</dd>
</dl>

<dl>

<dt id="XCPT_CATCH"><a class="permalink" href="perlapi.html#XCPT_CATCH">#</a><code>XCPT_CATCH</code> </dt>
<dd>

<p>Introduces a catch block. See <a href="perlguts.html#Exception-Handling">&quot;Exception Handling&quot; in perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="XCPT_RETHROW"><a class="permalink" href="perlapi.html#XCPT_RETHROW">#</a><code>XCPT_RETHROW</code> </dt>
<dd>

<p>Rethrows a previously caught exception. See <a href="perlguts.html#Exception-Handling">&quot;Exception Handling&quot; in perlguts</a>.</p>

<ul>

<pre><code>XCPT_RETHROW;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XCPT_TRY_END"><a class="permalink" href="perlapi.html#XCPT_TRY_END">#</a><code>XCPT_TRY_END</code> </dt>
<dd>

<p>Ends a try block. See <a href="perlguts.html#Exception-Handling">&quot;Exception Handling&quot; in perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="XCPT_TRY_START"><a class="permalink" href="perlapi.html#XCPT_TRY_START">#</a><code>XCPT_TRY_START</code> </dt>
<dd>

<p>Starts a try block. See <a href="perlguts.html#Exception-Handling">&quot;Exception Handling&quot; in perlguts</a>.</p>

</dd>
</dl>

<h1 id="Filesystem-configuration-values"><a class="permalink" href="perlapi.html#Filesystem-configuration-values">#</a><a id="Filesystem"></a>Filesystem configuration values</h1>

<p>Also see <a href="perlapi.html#List-of-capability-HAS_foo-symbols">&quot;List of capability HAS_foo symbols&quot;</a>.</p>

<dl>

<dt id="DIRNAMLEN"><a class="permalink" href="perlapi.html#DIRNAMLEN">#</a><code>DIRNAMLEN</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the length of directory entry names is provided by a <code>d_namlen</code> field. Otherwise you need to do <code>strlen()</code> on the <code>d_name</code> field.</p>

</dd>
</dl>

<dl>

<dt id="DOSUID"><a class="permalink" href="perlapi.html#DOSUID">#</a><code>DOSUID</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the C program should check the script that it is executing for setuid/setgid bits, and attempt to emulate setuid/setgid on systems that have disabled setuid #! scripts because the kernel can&#39;t do it securely. It is up to the package designer to make sure that this emulation is done securely. Among other things, it should do an fstat on the script it just opened to make sure it really is a setuid/setgid script, it should make sure the arguments passed correspond exactly to the argument on the #! line, and it should not trust any subprocesses to which it must pass the filename rather than the file descriptor of the script to be executed.</p>

</dd>
</dl>

<dl>

<dt id="EOF_NONBLOCK"><a class="permalink" href="perlapi.html#EOF_NONBLOCK">#</a><code>EOF_NONBLOCK</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that a <code>read()</code> on a non-blocking file descriptor will return 0 on <code>EOF</code>, and not the value held in <code>RD_NODATA</code> (-1 usually, in that case!).</p>

</dd>
</dl>

<dl>

<dt id="FCNTL_CAN_LOCK"><a class="permalink" href="perlapi.html#FCNTL_CAN_LOCK">#</a><code>FCNTL_CAN_LOCK</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>fcntl()</code> can be used for file locking. Normally on Unix systems this is defined. It may be undefined on <code>VMS</code>.</p>

</dd>
</dl>

<dl>

<dt id="FFLUSH_ALL"><a class="permalink" href="perlapi.html#FFLUSH_ALL">#</a><code>FFLUSH_ALL</code> </dt>
<dd>

<p>This symbol, if defined, tells that to flush all pending stdio output one must loop through all the stdio file handles stored in an array and fflush them. Note that if <code>fflushNULL</code> is defined, fflushall will not even be probed for and will be left undefined.</p>

</dd>
</dl>

<dl>

<dt id="FFLUSH_NULL"><a class="permalink" href="perlapi.html#FFLUSH_NULL">#</a><code>FFLUSH_NULL</code> </dt>
<dd>

<p>This symbol, if defined, tells that <code>fflush(NULL)</code> correctly flushes all pending stdio output without side effects. In particular, on some platforms calling <code>fflush(NULL)</code> *still* corrupts <code>STDIN</code> if it is a pipe.</p>

</dd>
</dl>

<dl>

<dt id="FILE_base"><a class="permalink" href="perlapi.html#FILE_base">#</a><code>FILE_base</code> </dt>
<dd>

<p>This macro is used to access the <code>_base</code> field (or equivalent) of the <code>FILE</code> structure pointed to by its argument. This macro will always be defined if <code>USE_STDIO_BASE</code> is defined.</p>

<ul>

<pre><code class="plaintext">void *  FILE_base(FILE * f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="FILE_bufsiz"><a class="permalink" href="perlapi.html#FILE_bufsiz">#</a><code>FILE_bufsiz</code> </dt>
<dd>

<p>This macro is used to determine the number of bytes in the I/O buffer pointed to by <code>_base</code> field (or equivalent) of the <code>FILE</code> structure pointed to its argument. This macro will always be defined if <code>USE_STDIO_BASE</code> is defined.</p>

<ul>

<pre><code class="plaintext">Size_t  FILE_bufsiz(FILE *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="FILE_cnt"><a class="permalink" href="perlapi.html#FILE_cnt">#</a><code>FILE_cnt</code> </dt>
<dd>

<p>This macro is used to access the <code>_cnt</code> field (or equivalent) of the <code>FILE</code> structure pointed to by its argument. This macro will always be defined if <code>USE_STDIO_PTR</code> is defined.</p>

<ul>

<pre><code class="plaintext">Size_t  FILE_cnt(FILE * f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="FILE_ptr"><a class="permalink" href="perlapi.html#FILE_ptr">#</a><code>FILE_ptr</code> </dt>
<dd>

<p>This macro is used to access the <code>_ptr</code> field (or equivalent) of the <code>FILE</code> structure pointed to by its argument. This macro will always be defined if <code>USE_STDIO_PTR</code> is defined.</p>

<ul>

<pre><code class="plaintext">void *  FILE_ptr(FILE * f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="FLEXFILENAMES"><a class="permalink" href="perlapi.html#FLEXFILENAMES">#</a><code>FLEXFILENAMES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system supports filenames longer than 14 characters.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DIR_DD_FD"><a class="permalink" href="perlapi.html#HAS_DIR_DD_FD">#</a><code>HAS_DIR_DD_FD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the the <code>DIR</code>* dirstream structure contains a member variable named <code>dd_fd</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DUP2"><a class="permalink" href="perlapi.html#HAS_DUP2">#</a><code>HAS_DUP2</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>dup2</code> routine is available to duplicate file descriptors.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DUP3"><a class="permalink" href="perlapi.html#HAS_DUP3">#</a><code>HAS_DUP3</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>dup3</code> routine is available to duplicate file descriptors.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FAST_STDIO"><a class="permalink" href="perlapi.html#HAS_FAST_STDIO">#</a><code>HAS_FAST_STDIO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the &quot;fast stdio&quot; is available to manipulate the stdio buffers directly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FCHDIR"><a class="permalink" href="perlapi.html#HAS_FCHDIR">#</a><code>HAS_FCHDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fchdir</code> routine is available to change directory using a file descriptor.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FCNTL"><a class="permalink" href="perlapi.html#HAS_FCNTL">#</a><code>HAS_FCNTL</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>fcntl()</code> function exists.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FDCLOSE"><a class="permalink" href="perlapi.html#HAS_FDCLOSE">#</a><code>HAS_FDCLOSE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fdclose</code> routine is available to free a <code>FILE</code> structure without closing the underlying file descriptor. This function appeared in <code>FreeBSD</code> 10.2.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FPATHCONF"><a class="permalink" href="perlapi.html#HAS_FPATHCONF">#</a><code>HAS_FPATHCONF</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>pathconf()</code> is available to determine file-system related limits and options associated with a given open file descriptor.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FPOS64_T"><a class="permalink" href="perlapi.html#HAS_FPOS64_T">#</a><code>HAS_FPOS64_T</code> </dt>
<dd>

<p>This symbol will be defined if the C compiler supports <code>fpos64_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FSTATFS"><a class="permalink" href="perlapi.html#HAS_FSTATFS">#</a><code>HAS_FSTATFS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fstatfs</code> routine is available to stat filesystems by file descriptors.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FSTATVFS"><a class="permalink" href="perlapi.html#HAS_FSTATVFS">#</a><code>HAS_FSTATVFS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fstatvfs</code> routine is available to stat filesystems by file descriptors.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETFSSTAT"><a class="permalink" href="perlapi.html#HAS_GETFSSTAT">#</a><code>HAS_GETFSSTAT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getfsstat</code> routine is available to stat filesystems in bulk.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETMNT"><a class="permalink" href="perlapi.html#HAS_GETMNT">#</a><code>HAS_GETMNT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getmnt</code> routine is available to get filesystem mount info by filename.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETMNTENT"><a class="permalink" href="perlapi.html#HAS_GETMNTENT">#</a><code>HAS_GETMNTENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getmntent</code> routine is available to iterate through mounted file systems to get their info.</p>

</dd>
</dl>

<dl>

<dt id="HAS_HASMNTOPT"><a class="permalink" href="perlapi.html#HAS_HASMNTOPT">#</a><code>HAS_HASMNTOPT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>hasmntopt</code> routine is available to query the mount options of file systems.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LSEEK_PROTO"><a class="permalink" href="perlapi.html#HAS_LSEEK_PROTO">#</a><code>HAS_LSEEK_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>lseek()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern off_t lseek(int, off_t, int);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_MKDIR"><a class="permalink" href="perlapi.html#HAS_MKDIR">#</a><code>HAS_MKDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>mkdir</code> routine is available to create directories. Otherwise you should fork off a new process to exec <i>/bin/mkdir</i>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_OFF64_T"><a class="permalink" href="perlapi.html#HAS_OFF64_T">#</a><code>HAS_OFF64_T</code> </dt>
<dd>

<p>This symbol will be defined if the C compiler supports <code>off64_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_OPEN3"><a class="permalink" href="perlapi.html#HAS_OPEN3">#</a><code>HAS_OPEN3</code> </dt>
<dd>

<p>This manifest constant lets the C program know that the three argument form of <code>open(2)</code> is available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_OPENAT"><a class="permalink" href="perlapi.html#HAS_OPENAT">#</a><code>HAS_OPENAT</code> </dt>
<dd>

<p>This symbol is defined if the <code>openat()</code> routine is available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_POLL"><a class="permalink" href="perlapi.html#HAS_POLL">#</a><code>HAS_POLL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>poll</code> routine is available to <code>poll</code> active file descriptors. Please check <code>I_POLL</code> and <code>I_SYS_POLL</code> to know which header should be included as well.</p>

</dd>
</dl>

<dl>

<dt id="HAS_READDIR"><a class="permalink" href="perlapi.html#HAS_READDIR">#</a><code>HAS_READDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>readdir</code> routine is available to read directory entries. You may have to include <i>dirent.h</i>. See <code><a href="perlapi.html#I_DIRENT">&quot;I_DIRENT&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_READDIR64_R"><a class="permalink" href="perlapi.html#HAS_READDIR64_R">#</a><code>HAS_READDIR64_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>readdir64_r</code> routine is available to readdir64 re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_REWINDDIR"><a class="permalink" href="perlapi.html#HAS_REWINDDIR">#</a><code>HAS_REWINDDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>rewinddir</code> routine is available. You may have to include <i>dirent.h</i>. See <code><a href="perlapi.html#I_DIRENT">&quot;I_DIRENT&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_RMDIR"><a class="permalink" href="perlapi.html#HAS_RMDIR">#</a><code>HAS_RMDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>rmdir</code> routine is available to remove directories. Otherwise you should fork off a new process to exec <i>/bin/rmdir</i>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SEEKDIR"><a class="permalink" href="perlapi.html#HAS_SEEKDIR">#</a><code>HAS_SEEKDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>seekdir</code> routine is available. You may have to include <i>dirent.h</i>. See <code><a href="perlapi.html#I_DIRENT">&quot;I_DIRENT&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SELECT"><a class="permalink" href="perlapi.html#HAS_SELECT">#</a><code>HAS_SELECT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>select</code> routine is available to <code>select</code> active file descriptors. If the timeout field is used, <i>sys/time.h</i> may need to be included.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETVBUF"><a class="permalink" href="perlapi.html#HAS_SETVBUF">#</a><code>HAS_SETVBUF</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setvbuf</code> routine is available to change buffering on an open stdio stream. to a line-buffered mode.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STDIO_STREAM_ARRAY"><a class="permalink" href="perlapi.html#HAS_STDIO_STREAM_ARRAY">#</a><code>HAS_STDIO_STREAM_ARRAY</code> </dt>
<dd>

<p>This symbol, if defined, tells that there is an array holding the stdio streams.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRUCT_FS_DATA"><a class="permalink" href="perlapi.html#HAS_STRUCT_FS_DATA">#</a><code>HAS_STRUCT_FS_DATA</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct fs_data</code> to do <code>statfs()</code> is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRUCT_STATFS"><a class="permalink" href="perlapi.html#HAS_STRUCT_STATFS">#</a><code>HAS_STRUCT_STATFS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct statfs</code> to do <code>statfs()</code> is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRUCT_STATFS_F_FLAGS"><a class="permalink" href="perlapi.html#HAS_STRUCT_STATFS_F_FLAGS">#</a><code>HAS_STRUCT_STATFS_F_FLAGS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct statfs</code> does have the <code>f_flags</code> member containing the mount flags of the filesystem containing the file. This kind of <code>struct statfs</code> is coming from <i>sys/mount.h</i> (<code>BSD</code> 4.3), not from <i>sys/statfs.h</i> (<code>SYSV</code>). Older <code>BSDs</code> (like Ultrix) do not have <code>statfs()</code> and <code>struct statfs</code>, they have <code>ustat()</code> and <code>getmnt()</code> with <code>struct ustat</code> and <code>struct fs_data</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TELLDIR"><a class="permalink" href="perlapi.html#HAS_TELLDIR">#</a><code>HAS_TELLDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>telldir</code> routine is available. You may have to include <i>dirent.h</i>. See <code><a href="perlapi.html#I_DIRENT">&quot;I_DIRENT&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_USTAT"><a class="permalink" href="perlapi.html#HAS_USTAT">#</a><code>HAS_USTAT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>ustat</code> system call is available to query file system statistics by <code>dev_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="I_FCNTL"><a class="permalink" href="perlapi.html#I_FCNTL">#</a><code>I_FCNTL</code> </dt>
<dd>

<p>This manifest constant tells the C program to include <i>fcntl.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_FCNTL
    #include &lt;fcntl.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_DIR"><a class="permalink" href="perlapi.html#I_SYS_DIR">#</a><code>I_SYS_DIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>sys/dir.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_DIR
    #include &lt;sys_dir.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_FILE"><a class="permalink" href="perlapi.html#I_SYS_FILE">#</a><code>I_SYS_FILE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>sys/file.h</i> to get definition of <code>R_OK</code> and friends.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_FILE
    #include &lt;sys_file.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_NDIR"><a class="permalink" href="perlapi.html#I_SYS_NDIR">#</a><code>I_SYS_NDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>sys/ndir.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_NDIR
    #include &lt;sys_ndir.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_STATFS"><a class="permalink" href="perlapi.html#I_SYS_STATFS">#</a><code>I_SYS_STATFS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>sys/statfs.h</i> exists.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_STATFS
    #include &lt;sys_statfs.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LSEEKSIZE"><a class="permalink" href="perlapi.html#LSEEKSIZE">#</a><code>LSEEKSIZE</code> </dt>
<dd>

<p>This symbol holds the number of bytes used by the <code>Off_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="RD_NODATA"><a class="permalink" href="perlapi.html#RD_NODATA">#</a><code>RD_NODATA</code> </dt>
<dd>

<p>This symbol holds the return code from <code>read()</code> when no data is present on the non-blocking file descriptor. Be careful! If <code>EOF_NONBLOCK</code> is not defined, then you can&#39;t distinguish between no data and <code>EOF</code> by issuing a <code>read()</code>. You&#39;ll have to find another way to tell for sure!</p>

</dd>
</dl>

<dl>

<dt id="READDIR64_R_PROTO"><a class="permalink" href="perlapi.html#READDIR64_R_PROTO">#</a><code>READDIR64_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>readdir64_r</code>. It is zero if <code>d_readdir64_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_readdir64_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="STDCHAR"><a class="permalink" href="perlapi.html#STDCHAR">#</a><code>STDCHAR</code> </dt>
<dd>

<p>This symbol is defined to be the type of char used in <i>stdio.h</i>. It has the values &quot;unsigned char&quot; or &quot;char&quot;.</p>

</dd>
</dl>

<dl>

<dt id="STDIO_CNT_LVALUE"><a class="permalink" href="perlapi.html#STDIO_CNT_LVALUE">#</a><code>STDIO_CNT_LVALUE</code> </dt>
<dd>

<p>This symbol is defined if the <code>FILE_cnt</code> macro can be used as an lvalue.</p>

</dd>
</dl>

<dl>

<dt id="STDIO_PTR_LVALUE"><a class="permalink" href="perlapi.html#STDIO_PTR_LVALUE">#</a><code>STDIO_PTR_LVALUE</code> </dt>
<dd>

<p>This symbol is defined if the <code>FILE_ptr</code> macro can be used as an lvalue.</p>

</dd>
</dl>

<dl>

<dt id="STDIO_PTR_LVAL_NOCHANGE_CNT"><a class="permalink" href="perlapi.html#STDIO_PTR_LVAL_NOCHANGE_CNT">#</a><code>STDIO_PTR_LVAL_NOCHANGE_CNT</code> </dt>
<dd>

<p>This symbol is defined if using the <code>FILE_ptr</code> macro as an lvalue to increase the pointer by n leaves <code>File_cnt(fp)</code> unchanged.</p>

</dd>
</dl>

<dl>

<dt id="STDIO_PTR_LVAL_SETS_CNT"><a class="permalink" href="perlapi.html#STDIO_PTR_LVAL_SETS_CNT">#</a><code>STDIO_PTR_LVAL_SETS_CNT</code> </dt>
<dd>

<p>This symbol is defined if using the <code>FILE_ptr</code> macro as an lvalue to increase the pointer by n has the side effect of decreasing the value of <code>File_cnt(fp)</code> by n.</p>

</dd>
</dl>

<dl>

<dt id="STDIO_STREAM_ARRAY"><a class="permalink" href="perlapi.html#STDIO_STREAM_ARRAY">#</a><code>STDIO_STREAM_ARRAY</code> </dt>
<dd>

<p>This symbol tells the name of the array holding the stdio streams. Usual values include <code>_iob</code>, <code>__iob</code>, and <code>__sF</code>.</p>

</dd>
</dl>

<dl>

<dt id="ST_INO_SIGN"><a class="permalink" href="perlapi.html#ST_INO_SIGN">#</a><code>ST_INO_SIGN</code> </dt>
<dd>

<p>This symbol holds the signedness of <code>struct stat</code>&#39;s <code>st_ino</code>. 1 for unsigned, -1 for signed.</p>

</dd>
</dl>

<dl>

<dt id="ST_INO_SIZE"><a class="permalink" href="perlapi.html#ST_INO_SIZE">#</a><code>ST_INO_SIZE</code> </dt>
<dd>

<p>This variable contains the size of <code>struct stat</code>&#39;s <code>st_ino</code> in bytes.</p>

</dd>
</dl>

<dl>

<dt id="VAL_EAGAIN"><a class="permalink" href="perlapi.html#VAL_EAGAIN">#</a><code>VAL_EAGAIN</code> </dt>
<dd>

<p>This symbol holds the errno error code set by <code>read()</code> when no data was present on the non-blocking file descriptor.</p>

</dd>
</dl>

<dl>

<dt id="VAL_O_NONBLOCK"><a class="permalink" href="perlapi.html#VAL_O_NONBLOCK">#</a><code>VAL_O_NONBLOCK</code> </dt>
<dd>

<p>This symbol is to be used during <code>open()</code> or <code>fcntl(F_SETFL)</code> to turn on non-blocking I/O for the file descriptor. Note that there is no way back, i.e. you cannot turn it blocking again this way. If you wish to alternatively switch between blocking and non-blocking, use the <code>ioctl(FIOSNBIO)</code> call instead, but that is not supported by all devices.</p>

</dd>
</dl>

<dl>

<dt id="VOID_CLOSEDIR"><a class="permalink" href="perlapi.html#VOID_CLOSEDIR">#</a><code>VOID_CLOSEDIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>closedir()</code> routine does not return a value.</p>

</dd>
</dl>

<h1 id="Floating-point-configuration-values"><a class="permalink" href="perlapi.html#Floating-point-configuration-values">#</a><a id="Floating"></a>Floating point configuration values</h1>

<p>Also <a href="perlapi.html#List-of-capability-HAS_foo-symbols">&quot;List of capability HAS_foo symbols&quot;</a> lists capabilities that arent in this section. For example <code>HAS_ASINH</code>, for the hyperbolic sine function.</p>

<dl>

<dt id="CASTFLAGS"><a class="permalink" href="perlapi.html#CASTFLAGS">#</a><code>CASTFLAGS</code> </dt>
<dd>

<p>This symbol contains flags that say what difficulties the compiler has casting odd floating values to unsigned long:</p>

<pre><code class="plaintext">0 = ok
1 = couldn&#39;t cast &lt; 0
2 = couldn&#39;t cast &gt;= 0x80000000
4 = couldn&#39;t cast in argument expression list</code></pre>

</dd>
</dl>

<dl>

<dt id="CASTNEGFLOAT"><a class="permalink" href="perlapi.html#CASTNEGFLOAT">#</a><code>CASTNEGFLOAT</code> </dt>
<dd>

<p>This symbol is defined if the C compiler can cast negative numbers to unsigned longs, ints and shorts.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_HAS_INF"><a class="permalink" href="perlapi.html#DOUBLE_HAS_INF">#</a><code>DOUBLE_HAS_INF</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double has the infinity.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_HAS_NAN"><a class="permalink" href="perlapi.html#DOUBLE_HAS_NAN">#</a><code>DOUBLE_HAS_NAN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double has the not-a-number.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_HAS_NEGATIVE_ZERO"><a class="permalink" href="perlapi.html#DOUBLE_HAS_NEGATIVE_ZERO">#</a><code>DOUBLE_HAS_NEGATIVE_ZERO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double has the <code>negative_zero</code>.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_HAS_SUBNORMALS"><a class="permalink" href="perlapi.html#DOUBLE_HAS_SUBNORMALS">#</a><code>DOUBLE_HAS_SUBNORMALS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double has the subnormals (denormals).</p>

</dd>
</dl>

<dl>

<dt id="DOUBLEINFBYTES"><a class="permalink" href="perlapi.html#DOUBLEINFBYTES">#</a><code>DOUBLEINFBYTES</code> </dt>
<dd>

<p>This symbol, if defined, is a comma-separated list of hexadecimal bytes for the double precision infinity.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLEKIND"><a class="permalink" href="perlapi.html#DOUBLEKIND">#</a><code>DOUBLEKIND</code> </dt>
<dd>

<p><code>DOUBLEKIND</code> will be one of <code>DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN</code> <code>DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE</code> <code>DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE</code> <code>DOUBLE_IS_VAX_F_FLOAT</code> <code>DOUBLE_IS_VAX_D_FLOAT</code> <code>DOUBLE_IS_VAX_G_FLOAT</code> <code>DOUBLE_IS_IBM_SINGLE_32_BIT</code> <code>DOUBLE_IS_IBM_DOUBLE_64_BIT</code> <code>DOUBLE_IS_CRAY_SINGLE_64_BIT</code> <code>DOUBLE_IS_UNKNOWN_FORMAT</code></p>

</dd>
</dl>

<dl>

<dt id="DOUBLEMANTBITS"><a class="permalink" href="perlapi.html#DOUBLEMANTBITS">#</a><code>DOUBLEMANTBITS</code> </dt>
<dd>

<p>This symbol, if defined, tells how many mantissa bits there are in double precision floating point format. Note that this is usually <code>DBL_MANT_DIG</code> minus one, since with the standard <code>IEEE</code> 754 formats <code>DBL_MANT_DIG</code> includes the implicit bit, which doesn&#39;t really exist.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLENANBYTES"><a class="permalink" href="perlapi.html#DOUBLENANBYTES">#</a><code>DOUBLENANBYTES</code> </dt>
<dd>

<p>This symbol, if defined, is a comma-separated list of hexadecimal bytes (0xHH) for the double precision not-a-number.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLESIZE"><a class="permalink" href="perlapi.html#DOUBLESIZE">#</a><code>DOUBLESIZE</code> </dt>
<dd>

<p>This symbol contains the size of a double, so that the C preprocessor can make decisions based on it.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_STYLE_CRAY"><a class="permalink" href="perlapi.html#DOUBLE_STYLE_CRAY">#</a><code>DOUBLE_STYLE_CRAY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double is the 64-bit <code>CRAY</code> mainframe format.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_STYLE_IBM"><a class="permalink" href="perlapi.html#DOUBLE_STYLE_IBM">#</a><code>DOUBLE_STYLE_IBM</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double is the 64-bit <code>IBM</code> mainframe format.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_STYLE_IEEE"><a class="permalink" href="perlapi.html#DOUBLE_STYLE_IEEE">#</a><code>DOUBLE_STYLE_IEEE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double is the 64-bit <code>IEEE</code> 754.</p>

</dd>
</dl>

<dl>

<dt id="DOUBLE_STYLE_VAX"><a class="permalink" href="perlapi.html#DOUBLE_STYLE_VAX">#</a><code>DOUBLE_STYLE_VAX</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the double is the 64-bit <code>VAX</code> format D or G.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ATOLF"><a class="permalink" href="perlapi.html#HAS_ATOLF">#</a><code>HAS_ATOLF</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>atolf</code> routine is available to convert strings into long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_CLASS"><a class="permalink" href="perlapi.html#HAS_CLASS">#</a><code>HAS_CLASS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>class</code> routine is available to classify doubles. Available for example in <code>AIX</code>. The returned values are defined in <i>float.h</i> and are:</p>

<pre><code class="plaintext">FP_PLUS_NORM    Positive normalized, nonzero
FP_MINUS_NORM   Negative normalized, nonzero
FP_PLUS_DENORM  Positive denormalized, nonzero
FP_MINUS_DENORM Negative denormalized, nonzero
FP_PLUS_ZERO    +0.0
FP_MINUS_ZERO   -0.0
FP_PLUS_INF     +INF
FP_MINUS_INF    -INF
FP_NANS         Signaling Not a Number (NaNS)
FP_NANQ         Quiet Not a Number (NaNQ)</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FINITE"><a class="permalink" href="perlapi.html#HAS_FINITE">#</a><code>HAS_FINITE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>finite</code> routine is available to check whether a double is <code>finite</code> (non-infinity non-NaN).</p>

</dd>
</dl>

<dl>

<dt id="HAS_FINITEL"><a class="permalink" href="perlapi.html#HAS_FINITEL">#</a><code>HAS_FINITEL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>finitel</code> routine is available to check whether a long double is finite (non-infinity non-NaN).</p>

</dd>
</dl>

<dl>

<dt id="HAS_FPCLASS"><a class="permalink" href="perlapi.html#HAS_FPCLASS">#</a><code>HAS_FPCLASS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fpclass</code> routine is available to classify doubles. Available for example in Solaris/<code>SVR4</code>. The returned values are defined in <i>ieeefp.h</i> and are:</p>

<pre><code class="plaintext">FP_SNAN         signaling NaN
FP_QNAN         quiet NaN
FP_NINF         negative infinity
FP_PINF         positive infinity
FP_NDENORM      negative denormalized non-zero
FP_PDENORM      positive denormalized non-zero
FP_NZERO        negative zero
FP_PZERO        positive zero
FP_NNORM        negative normalized non-zero
FP_PNORM        positive normalized non-zero</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FPCLASSIFY"><a class="permalink" href="perlapi.html#HAS_FPCLASSIFY">#</a><code>HAS_FPCLASSIFY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fpclassify</code> routine is available to classify doubles. Available for example in HP-UX. The returned values are defined in <i>math.h</i> and are</p>

<pre><code class="plaintext">FP_NORMAL     Normalized
FP_ZERO       Zero
FP_INFINITE   Infinity
FP_SUBNORMAL  Denormalized
FP_NAN        NaN</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FPCLASSL"><a class="permalink" href="perlapi.html#HAS_FPCLASSL">#</a><code>HAS_FPCLASSL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fpclassl</code> routine is available to classify long doubles. Available for example in <code>IRIX</code>. The returned values are defined in <i>ieeefp.h</i> and are:</p>

<pre><code class="plaintext">FP_SNAN         signaling NaN
FP_QNAN         quiet NaN
FP_NINF         negative infinity
FP_PINF         positive infinity
FP_NDENORM      negative denormalized non-zero
FP_PDENORM      positive denormalized non-zero
FP_NZERO        negative zero
FP_PZERO        positive zero
FP_NNORM        negative normalized non-zero
FP_PNORM        positive normalized non-zero</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FPGETROUND"><a class="permalink" href="perlapi.html#HAS_FPGETROUND">#</a><code>HAS_FPGETROUND</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fpgetround</code> routine is available to get the floating point rounding mode.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FP_CLASS"><a class="permalink" href="perlapi.html#HAS_FP_CLASS">#</a><code>HAS_FP_CLASS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fp_class</code> routine is available to classify doubles. Available for example in Digital <code>UNIX</code>. The returned values are defined in <i>math.h</i> and are:</p>

<pre><code class="plaintext">FP_SNAN           Signaling NaN (Not-a-Number)
FP_QNAN           Quiet NaN (Not-a-Number)
FP_POS_INF        +infinity
FP_NEG_INF        -infinity
FP_POS_NORM       Positive normalized
FP_NEG_NORM       Negative normalized
FP_POS_DENORM     Positive denormalized
FP_NEG_DENORM     Negative denormalized
FP_POS_ZERO       +0.0 (positive zero)
FP_NEG_ZERO       -0.0 (negative zero)</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FP_CLASSIFY"><a class="permalink" href="perlapi.html#HAS_FP_CLASSIFY">#</a><code>HAS_FP_CLASSIFY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fp_classify</code> routine is available to classify doubles. The values are defined in <i>math.h</i></p>

<pre><code class="plaintext">FP_NORMAL     Normalized
FP_ZERO       Zero
FP_INFINITE   Infinity
FP_SUBNORMAL  Denormalized
FP_NAN        NaN</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FP_CLASSL"><a class="permalink" href="perlapi.html#HAS_FP_CLASSL">#</a><code>HAS_FP_CLASSL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>fp_classl</code> routine is available to classify long doubles. Available for example in Digital <code>UNIX</code>. See for possible values <code>HAS_FP_CLASS</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FREXPL"><a class="permalink" href="perlapi.html#HAS_FREXPL">#</a><code>HAS_FREXPL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>frexpl</code> routine is available to break a long double floating-point number into a normalized fraction and an integral power of 2.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ILOGB"><a class="permalink" href="perlapi.html#HAS_ILOGB">#</a><code>HAS_ILOGB</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>ilogb</code> routine is available to get integer exponent of a floating-point value.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISFINITE"><a class="permalink" href="perlapi.html#HAS_ISFINITE">#</a><code>HAS_ISFINITE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isfinite</code> routine is available to check whether a double is finite (non-infinity non-NaN).</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISFINITEL"><a class="permalink" href="perlapi.html#HAS_ISFINITEL">#</a><code>HAS_ISFINITEL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isfinitel</code> routine is available to check whether a long double is finite. (non-infinity non-NaN).</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISINF"><a class="permalink" href="perlapi.html#HAS_ISINF">#</a><code>HAS_ISINF</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isinf</code> routine is available to check whether a double is an infinity.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISINFL"><a class="permalink" href="perlapi.html#HAS_ISINFL">#</a><code>HAS_ISINFL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isinfl</code> routine is available to check whether a long double is an infinity.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISNAN"><a class="permalink" href="perlapi.html#HAS_ISNAN">#</a><code>HAS_ISNAN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isnan</code> routine is available to check whether a double is a NaN.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISNANL"><a class="permalink" href="perlapi.html#HAS_ISNANL">#</a><code>HAS_ISNANL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isnanl</code> routine is available to check whether a long double is a NaN.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ISNORMAL"><a class="permalink" href="perlapi.html#HAS_ISNORMAL">#</a><code>HAS_ISNORMAL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>isnormal</code> routine is available to check whether a double is normal (non-zero normalized).</p>

</dd>
</dl>

<dl>

<dt id="HAS_J0"><a class="permalink" href="perlapi.html#HAS_J0">#</a><code>HAS_J0</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>j0()</code> function is available for Bessel functions of the first kind of the order zero, for doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_J0L"><a class="permalink" href="perlapi.html#HAS_J0L">#</a><code>HAS_J0L</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>j0l()</code> function is available for Bessel functions of the first kind of the order zero, for long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LDBL_DIG"><a class="permalink" href="perlapi.html#HAS_LDBL_DIG">#</a><code>HAS_LDBL_DIG</code> </dt>
<dd>

<p>This symbol, if defined, indicates that this system&#39;s <i>float.h</i> or <i>limits.h</i> defines the symbol <code>LDBL_DIG</code>, which is the number of significant digits in a long double precision number. Unlike for <code>DBL_DIG</code>, there&#39;s no good guess for <code>LDBL_DIG</code> if it is undefined.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LDEXPL"><a class="permalink" href="perlapi.html#HAS_LDEXPL">#</a><code>HAS_LDEXPL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>ldexpl</code> routine is available to shift a long double floating-point number by an integral power of 2.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LLRINT"><a class="permalink" href="perlapi.html#HAS_LLRINT">#</a><code>HAS_LLRINT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>llrint</code> routine is available to return the long long value closest to a double (according to the current rounding mode).</p>

</dd>
</dl>

<dl>

<dt id="HAS_LLRINTL"><a class="permalink" href="perlapi.html#HAS_LLRINTL">#</a><code>HAS_LLRINTL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>llrintl</code> routine is available to return the long long value closest to a long double (according to the current rounding mode).</p>

</dd>
</dl>

<dl>

<dt id="HAS_LLROUNDL"><a class="permalink" href="perlapi.html#HAS_LLROUNDL">#</a><code>HAS_LLROUNDL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>llroundl</code> routine is available to return the nearest long long value away from zero of the long double argument value.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LONG_DOUBLE"><a class="permalink" href="perlapi.html#HAS_LONG_DOUBLE">#</a><code>HAS_LONG_DOUBLE</code> </dt>
<dd>

<p>This symbol will be defined if the C compiler supports long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LRINT"><a class="permalink" href="perlapi.html#HAS_LRINT">#</a><code>HAS_LRINT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>lrint</code> routine is available to return the integral value closest to a double (according to the current rounding mode).</p>

</dd>
</dl>

<dl>

<dt id="HAS_LRINTL"><a class="permalink" href="perlapi.html#HAS_LRINTL">#</a><code>HAS_LRINTL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>lrintl</code> routine is available to return the integral value closest to a long double (according to the current rounding mode).</p>

</dd>
</dl>

<dl>

<dt id="HAS_LROUNDL"><a class="permalink" href="perlapi.html#HAS_LROUNDL">#</a><code>HAS_LROUNDL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>lroundl</code> routine is available to return the nearest integral value away from zero of the long double argument value.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MODFL"><a class="permalink" href="perlapi.html#HAS_MODFL">#</a><code>HAS_MODFL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>modfl</code> routine is available to split a long double x into a fractional part f and an integer part i such that |f| &lt; 1.0 and (f + i) = x.</p>

</dd>
</dl>

<dl>

<dt id="HAS_NAN"><a class="permalink" href="perlapi.html#HAS_NAN">#</a><code>HAS_NAN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>nan</code> routine is available to generate NaN.</p>

</dd>
</dl>

<dl>

<dt id="HAS_NEXTTOWARD"><a class="permalink" href="perlapi.html#HAS_NEXTTOWARD">#</a><code>HAS_NEXTTOWARD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>nexttoward</code> routine is available to return the next machine representable long double from x in direction y.</p>

</dd>
</dl>

<dl>

<dt id="HAS_REMAINDER"><a class="permalink" href="perlapi.html#HAS_REMAINDER">#</a><code>HAS_REMAINDER</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>remainder</code> routine is available to return the floating-point <code>remainder</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SCALBN"><a class="permalink" href="perlapi.html#HAS_SCALBN">#</a><code>HAS_SCALBN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>scalbn</code> routine is available to multiply floating-point number by integral power of radix.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGNBIT"><a class="permalink" href="perlapi.html#HAS_SIGNBIT">#</a><code>HAS_SIGNBIT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>signbit</code> routine is available to check if the given number has the sign bit set. This should include correct testing of -0.0. This will only be set if the <code>signbit()</code> routine is safe to use with the NV type used internally in perl. Users should call <code>Perl_signbit()</code>, which will be #defined to the system&#39;s <code>signbit()</code> function or macro if this symbol is defined.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SQRTL"><a class="permalink" href="perlapi.html#HAS_SQRTL">#</a><code>HAS_SQRTL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>sqrtl</code> routine is available to do long double square roots.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRTOD_L"><a class="permalink" href="perlapi.html#HAS_STRTOD_L">#</a><code>HAS_STRTOD_L</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>strtod_l</code> routine is available to convert strings to long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRTOLD"><a class="permalink" href="perlapi.html#HAS_STRTOLD">#</a><code>HAS_STRTOLD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>strtold</code> routine is available to convert strings to long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRTOLD_L"><a class="permalink" href="perlapi.html#HAS_STRTOLD_L">#</a><code>HAS_STRTOLD_L</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>strtold_l</code> routine is available to convert strings to long doubles.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TRUNC"><a class="permalink" href="perlapi.html#HAS_TRUNC">#</a><code>HAS_TRUNC</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>trunc</code> routine is available to round doubles towards zero.</p>

</dd>
</dl>

<dl>

<dt id="HAS_UNORDERED"><a class="permalink" href="perlapi.html#HAS_UNORDERED">#</a><code>HAS_UNORDERED</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>unordered</code> routine is available to check whether two doubles are <code>unordered</code> (effectively: whether either of them is NaN)</p>

</dd>
</dl>

<dl>

<dt id="I_FENV"><a class="permalink" href="perlapi.html#I_FENV">#</a><code>I_FENV</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>fenv.h</i> to get the floating point environment definitions.</p>

<ul>

<pre><code class="plaintext">#ifdef I_FENV
    #include &lt;fenv.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_QUADMATH"><a class="permalink" href="perlapi.html#I_QUADMATH">#</a><code>I_QUADMATH</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>quadmath.h</i> exists and should be included.</p>

<ul>

<pre><code class="plaintext">#ifdef I_QUADMATH
    #include &lt;quadmath.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LONGDBLINFBYTES"><a class="permalink" href="perlapi.html#LONGDBLINFBYTES">#</a><code>LONGDBLINFBYTES</code> </dt>
<dd>

<p>This symbol, if defined, is a comma-separated list of hexadecimal bytes for the long double precision infinity.</p>

</dd>
</dl>

<dl>

<dt id="LONGDBLMANTBITS"><a class="permalink" href="perlapi.html#LONGDBLMANTBITS">#</a><code>LONGDBLMANTBITS</code> </dt>
<dd>

<p>This symbol, if defined, tells how many mantissa bits there are in long double precision floating point format. Note that this can be <code>LDBL_MANT_DIG</code> minus one, since <code>LDBL_MANT_DIG</code> can include the <code>IEEE</code> 754 implicit bit. The common x86-style 80-bit long double does not have an implicit bit.</p>

</dd>
</dl>

<dl>

<dt id="LONGDBLNANBYTES"><a class="permalink" href="perlapi.html#LONGDBLNANBYTES">#</a><code>LONGDBLNANBYTES</code> </dt>
<dd>

<p>This symbol, if defined, is a comma-separated list of hexadecimal bytes (0xHH) for the long double precision not-a-number.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLEKIND"><a class="permalink" href="perlapi.html#LONG_DOUBLEKIND">#</a><code>LONG_DOUBLEKIND</code> </dt>
<dd>

<p><code>LONG_DOUBLEKIND</code> will be one of <code>LONG_DOUBLE_IS_DOUBLE</code> <code>LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN</code> <code>LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN</code> <code>LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN</code> <code>LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN</code> <code>LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN</code> <code>LONG_DOUBLE_IS_VAX_H_FLOAT</code> <code>LONG_DOUBLE_IS_UNKNOWN_FORMAT</code> It is only defined if the system supports long doubles.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLESIZE"><a class="permalink" href="perlapi.html#LONG_DOUBLESIZE">#</a><code>LONG_DOUBLESIZE</code> </dt>
<dd>

<p>This symbol contains the size of a long double, so that the C preprocessor can make decisions based on it. It is only defined if the system supports long doubles. Note that this is <code>sizeof(long double)</code>, which may include unused bytes.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLE_STYLE_IEEE"><a class="permalink" href="perlapi.html#LONG_DOUBLE_STYLE_IEEE">#</a><code>LONG_DOUBLE_STYLE_IEEE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the long double is any of the <code>IEEE</code> 754 style long doubles: <code>LONG_DOUBLE_STYLE_IEEE_STD</code>, <code>LONG_DOUBLE_STYLE_IEEE_EXTENDED</code>, <code>LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE</code>.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE"><a class="permalink" href="perlapi.html#LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE">#</a><code>LONG_DOUBLE_STYLE_IEEE_DOUBLEDOUBLE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the long double is the 128-bit double-double.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLE_STYLE_IEEE_EXTENDED"><a class="permalink" href="perlapi.html#LONG_DOUBLE_STYLE_IEEE_EXTENDED">#</a><code>LONG_DOUBLE_STYLE_IEEE_EXTENDED</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the long double is the 80-bit <code>IEEE</code> 754. Note that despite the &#39;extended&#39; this is less than the &#39;std&#39;, since this is an extension of the double precision.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLE_STYLE_IEEE_STD"><a class="permalink" href="perlapi.html#LONG_DOUBLE_STYLE_IEEE_STD">#</a><code>LONG_DOUBLE_STYLE_IEEE_STD</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the long double is the 128-bit <code>IEEE</code> 754.</p>

</dd>
</dl>

<dl>

<dt id="LONG_DOUBLE_STYLE_VAX"><a class="permalink" href="perlapi.html#LONG_DOUBLE_STYLE_VAX">#</a><code>LONG_DOUBLE_STYLE_VAX</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the long double is the 128-bit <code>VAX</code> format H.</p>

</dd>
</dl>

<dl>

<dt id="NVMANTBITS"><a class="permalink" href="perlapi.html#NVMANTBITS">#</a><code>NVMANTBITS</code> </dt>
<dd>

<p>This symbol, if defined, tells how many mantissa bits (not including implicit bit) there are in a Perl NV. This depends on which floating point type was chosen.</p>

</dd>
</dl>

<dl>

<dt id="NV_OVERFLOWS_INTEGERS_AT"><a class="permalink" href="perlapi.html#NV_OVERFLOWS_INTEGERS_AT">#</a><code>NV_OVERFLOWS_INTEGERS_AT</code> </dt>
<dd>

<p>This symbol gives the largest integer value that NVs can hold. This value + 1.0 cannot be stored accurately. It is expressed as constant floating point expression to reduce the chance of decimal/binary conversion issues. If it can not be determined, the value 0 is given.</p>

</dd>
</dl>

<dl>

<dt id="NV_PRESERVES_UV"><a class="permalink" href="perlapi.html#NV_PRESERVES_UV">#</a><code>NV_PRESERVES_UV</code> </dt>
<dd>

<p>This symbol, if defined, indicates that a variable of type <code>NVTYPE</code> can preserve all the bits of a variable of type <code>UVTYPE</code>.</p>

</dd>
</dl>

<dl>

<dt id="NV_PRESERVES_UV_BITS"><a class="permalink" href="perlapi.html#NV_PRESERVES_UV_BITS">#</a><code>NV_PRESERVES_UV_BITS</code> </dt>
<dd>

<p>This symbol contains the number of bits a variable of type <code>NVTYPE</code> can preserve of a variable of type <code>UVTYPE</code>.</p>

</dd>
</dl>

<dl>

<dt id="NVSIZE"><a class="permalink" href="perlapi.html#NVSIZE">#</a><code>NVSIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(NV)</code>. Note that some floating point formats have unused bytes. The most notable example is the x86* 80-bit extended precision which comes in byte sizes of 12 and 16 (for 32 and 64 bit platforms, respectively), but which only uses 10 bytes. Perl compiled with <code>-Duselongdouble</code> on x86* is like this.</p>

</dd>
</dl>

<dl>

<dt id="NVTYPE"><a class="permalink" href="perlapi.html#NVTYPE">#</a><code>NVTYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s NV.</p>

</dd>
</dl>

<dl>

<dt id="NV_ZERO_IS_ALLBITS_ZERO"><a class="permalink" href="perlapi.html#NV_ZERO_IS_ALLBITS_ZERO">#</a><code>NV_ZERO_IS_ALLBITS_ZERO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that a variable of type <code>NVTYPE</code> stores 0.0 in memory as all bits zero.</p>

</dd>
</dl>

<h1 id="Formats"><a class="permalink" href="perlapi.html#Formats">#</a>Formats</h1>

<p>These are used for formatting the corresponding type For example, instead of saying</p>

<pre><code>Perl_newSVpvf(pTHX_ &quot;Create an SV with a %d in it\n&quot;, iv);</code></pre>

<p>use</p>

<pre><code>Perl_newSVpvf(pTHX_ &quot;Create an SV with a &quot; IVdf &quot; in it\n&quot;, iv);</code></pre>

<p>This keeps you from having to know if, say an IV, needs to be printed as <code>%d</code>, <code>%ld</code>, or something else.</p>

<dl>

<dt id="IVdf"><a class="permalink" href="perlapi.html#IVdf">#</a><code>IVdf</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl IV as a signed decimal integer.</p>

</dd>
</dl>

<dl>

<dt id="NVef"><a class="permalink" href="perlapi.html#NVef">#</a><code>NVef</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl NV using %e-ish floating point format.</p>

</dd>
</dl>

<dl>

<dt id="NVff"><a class="permalink" href="perlapi.html#NVff">#</a><code>NVff</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl NV using %f-ish floating point format.</p>

</dd>
</dl>

<dl>

<dt id="NVgf"><a class="permalink" href="perlapi.html#NVgf">#</a><code>NVgf</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl NV using %g-ish floating point format.</p>

</dd>
</dl>

<dl>

<dt id="PERL_PRIeldbl"><a class="permalink" href="perlapi.html#PERL_PRIeldbl">#</a><code>PERL_PRIeldbl</code> </dt>
<dd>

<p>This symbol, if defined, contains the string used by stdio to format long doubles (format &#39;e&#39;) for output.</p>

</dd>
</dl>

<dl>

<dt id="PERL_PRIfldbl"><a class="permalink" href="perlapi.html#PERL_PRIfldbl">#</a><code>PERL_PRIfldbl</code> </dt>
<dd>

<p>This symbol, if defined, contains the string used by stdio to format long doubles (format &#39;f&#39;) for output.</p>

</dd>
</dl>

<dl>

<dt id="PERL_PRIgldbl"><a class="permalink" href="perlapi.html#PERL_PRIgldbl">#</a><code>PERL_PRIgldbl</code> </dt>
<dd>

<p>This symbol, if defined, contains the string used by stdio to format long doubles (format &#39;g&#39;) for output.</p>

</dd>
</dl>

<dl>

<dt id="PERL_SCNfldbl"><a class="permalink" href="perlapi.html#PERL_SCNfldbl">#</a><code>PERL_SCNfldbl</code> </dt>
<dd>

<p>This symbol, if defined, contains the string used by stdio to format long doubles (format &#39;f&#39;) for input.</p>

</dd>
</dl>

<dl>

<dt id="PRINTF_FORMAT_NULL_OK"><a class="permalink" href="perlapi.html#PRINTF_FORMAT_NULL_OK">#</a><code>PRINTF_FORMAT_NULL_OK</code> </dt>
<dd>

<p>Allows <code>__printf__</code> format to be null when checking printf-style</p>

</dd>
</dl>

<dl>

<dt id="UTF8f"><a class="permalink" href="perlapi.html#UTF8f">#</a><code>UTF8f</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="UTF8fARG"><a class="permalink" href="perlapi.html#UTF8fARG">#</a><code>UTF8fARG</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">UTF8fARG(bool is_utf8, Size_t byte_len, char *str)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UVof"><a class="permalink" href="perlapi.html#UVof">#</a><code>UVof</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl UV as an unsigned octal integer.</p>

</dd>
</dl>

<dl>

<dt id="UVuf"><a class="permalink" href="perlapi.html#UVuf">#</a><code>UVuf</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl UV as an unsigned decimal integer.</p>

</dd>
</dl>

<dl>

<dt id="UVXf"><a class="permalink" href="perlapi.html#UVXf">#</a><code>UVXf</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl UV as an unsigned hexadecimal integer in uppercase <code>ABCDEF</code>.</p>

</dd>
</dl>

<dl>

<dt id="UVxf"><a class="permalink" href="perlapi.html#UVxf">#</a><code>UVxf</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a Perl UV as an unsigned hexadecimal integer in lowercase abcdef.</p>

</dd>
</dl>

<h1 id="General-Configuration"><a class="permalink" href="perlapi.html#General-Configuration">#</a><a id="General"></a>General Configuration</h1>

<p>This section contains configuration information not otherwise found in the more specialized sections of this document. At the end is a list of <code>#defines</code> whose name should be enough to tell you what they do, and a list of #defines which tell you if you need to <code>#include</code> files to get the corresponding functionality.</p>

<dl>

<dt id="BYTEORDER"><a class="permalink" href="perlapi.html#BYTEORDER">#</a><code>BYTEORDER</code> </dt>
<dd>

<p>This symbol holds the hexadecimal constant defined in byteorder, in a UV, i.e. 0x1234 or 0x4321 or 0x12345678, etc... If the compiler supports cross-compiling or multiple-architecture binaries, use compiler-defined macros to determine the byte order.</p>

</dd>
</dl>

<dl>

<dt id="CHARBITS"><a class="permalink" href="perlapi.html#CHARBITS">#</a><code>CHARBITS</code> </dt>
<dd>

<p>This symbol contains the size of a char, so that the C preprocessor can make decisions based on it.</p>

</dd>
</dl>

<dl>

<dt id="DB_VERSION_MAJOR_CFG"><a class="permalink" href="perlapi.html#DB_VERSION_MAJOR_CFG">#</a><code>DB_VERSION_MAJOR_CFG</code> </dt>
<dd>

<p>This symbol, if defined, defines the major version number of Berkeley DB found in the <i>db.h</i> header when Perl was configured.</p>

</dd>
</dl>

<dl>

<dt id="DB_VERSION_MINOR_CFG"><a class="permalink" href="perlapi.html#DB_VERSION_MINOR_CFG">#</a><code>DB_VERSION_MINOR_CFG</code> </dt>
<dd>

<p>This symbol, if defined, defines the minor version number of Berkeley DB found in the <i>db.h</i> header when Perl was configured. For DB version 1 this is always 0.</p>

</dd>
</dl>

<dl>

<dt id="DB_VERSION_PATCH_CFG"><a class="permalink" href="perlapi.html#DB_VERSION_PATCH_CFG">#</a><code>DB_VERSION_PATCH_CFG</code> </dt>
<dd>

<p>This symbol, if defined, defines the patch version number of Berkeley DB found in the <i>db.h</i> header when Perl was configured. For DB version 1 this is always 0.</p>

</dd>
</dl>

<dl>

<dt id="DEFAULT_INC_EXCLUDES_DOT"><a class="permalink" href="perlapi.html#DEFAULT_INC_EXCLUDES_DOT">#</a><code>DEFAULT_INC_EXCLUDES_DOT</code> </dt>
<dd>

<p>This symbol, if defined, removes the legacy default behavior of including &#39;.&#39; at the end of @<code>INC</code>.</p>

</dd>
</dl>

<dl>

<dt id="DLSYM_NEEDS_UNDERSCORE"><a class="permalink" href="perlapi.html#DLSYM_NEEDS_UNDERSCORE">#</a><code>DLSYM_NEEDS_UNDERSCORE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we need to prepend an underscore to the symbol name before calling <code>dlsym()</code>. This only makes sense if you *have* dlsym, which we will presume is the case if you&#39;re using <i>dl_dlopen.xs</i>.</p>

</dd>
</dl>

<dl>

<dt id="EBCDIC"><a class="permalink" href="perlapi.html#EBCDIC">#</a><code>EBCDIC</code> </dt>
<dd>

<p>This symbol, if defined, indicates that this system uses <code>EBCDIC</code> encoding.</p>

</dd>
</dl>

<dl>

<dt id="HAS_CSH"><a class="permalink" href="perlapi.html#HAS_CSH">#</a><code>HAS_CSH</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the C-shell exists.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETHOSTNAME"><a class="permalink" href="perlapi.html#HAS_GETHOSTNAME">#</a><code>HAS_GETHOSTNAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the C program may use the <code>gethostname()</code> routine to derive the host name. See also <code><a href="perlapi.html#HAS_UNAME">&quot;HAS_UNAME&quot;</a></code> and <code><a href="perlapi.html#PHOSTNAME">&quot;PHOSTNAME&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GNULIBC"><a class="permalink" href="perlapi.html#HAS_GNULIBC">#</a><code>HAS_GNULIBC</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>GNU</code> C library is being used. A better check is to use the <code>__GLIBC__</code> and <code>__GLIBC_MINOR__</code> symbols supplied with glibc.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LGAMMA"><a class="permalink" href="perlapi.html#HAS_LGAMMA">#</a><code>HAS_LGAMMA</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>lgamma</code> routine is available to do the log gamma function. See also <code><a href="perlapi.html#HAS_TGAMMA">&quot;HAS_TGAMMA&quot;</a></code> and <code><a href="perlapi.html#HAS_LGAMMA_R">&quot;HAS_LGAMMA_R&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LGAMMA_R"><a class="permalink" href="perlapi.html#HAS_LGAMMA_R">#</a><code>HAS_LGAMMA_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>lgamma_r</code> routine is available to do the log gamma function without using the global signgam variable.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PRCTL_SET_NAME"><a class="permalink" href="perlapi.html#HAS_PRCTL_SET_NAME">#</a><code>HAS_PRCTL_SET_NAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the prctl routine is available to set process title and supports <code>PR_SET_NAME</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PROCSELFEXE"><a class="permalink" href="perlapi.html#HAS_PROCSELFEXE">#</a><code>HAS_PROCSELFEXE</code> </dt>
<dd>

<p>This symbol is defined if <code>PROCSELFEXE_PATH</code> is a symlink to the absolute pathname of the executing program.</p>

</dd>
</dl>

<dl>

<dt id="HAS_PSEUDOFORK"><a class="permalink" href="perlapi.html#HAS_PSEUDOFORK">#</a><code>HAS_PSEUDOFORK</code> </dt>
<dd>

<p>This symbol, if defined, indicates that an emulation of the fork routine is available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_REGCOMP"><a class="permalink" href="perlapi.html#HAS_REGCOMP">#</a><code>HAS_REGCOMP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>regcomp()</code> routine is available to do some regular pattern matching (usually on <code>POSIX</code>.2 conforming systems).</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETPGID"><a class="permalink" href="perlapi.html#HAS_SETPGID">#</a><code>HAS_SETPGID</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setpgid(pid, gpid)</code> routine is available to set process group ID.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGSETJMP"><a class="permalink" href="perlapi.html#HAS_SIGSETJMP">#</a><code>HAS_SIGSETJMP</code> </dt>
<dd>

<p>This variable indicates to the C program that the <code>sigsetjmp()</code> routine is available to save the calling process&#39;s registers and stack environment for later use by <code>siglongjmp()</code>, and to optionally save the process&#39;s signal mask. See <code><a href="perlapi.html#Sigjmp_buf">&quot;Sigjmp_buf&quot;</a></code>, <code><a href="perlapi.html#Sigsetjmp">&quot;Sigsetjmp&quot;</a></code>, and <code><a href="perlapi.html#Siglongjmp">&quot;Siglongjmp&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRUCT_CMSGHDR"><a class="permalink" href="perlapi.html#HAS_STRUCT_CMSGHDR">#</a><code>HAS_STRUCT_CMSGHDR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct cmsghdr</code> is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRUCT_MSGHDR"><a class="permalink" href="perlapi.html#HAS_STRUCT_MSGHDR">#</a><code>HAS_STRUCT_MSGHDR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct msghdr</code> is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TGAMMA"><a class="permalink" href="perlapi.html#HAS_TGAMMA">#</a><code>HAS_TGAMMA</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>tgamma</code> routine is available to do the gamma function. See also <code><a href="perlapi.html#HAS_LGAMMA">&quot;HAS_LGAMMA&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_UNAME"><a class="permalink" href="perlapi.html#HAS_UNAME">#</a><code>HAS_UNAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the C program may use the <code>uname()</code> routine to derive the host name. See also <code><a href="perlapi.html#HAS_GETHOSTNAME">&quot;HAS_GETHOSTNAME&quot;</a></code> and <code><a href="perlapi.html#PHOSTNAME">&quot;PHOSTNAME&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_UNION_SEMUN"><a class="permalink" href="perlapi.html#HAS_UNION_SEMUN">#</a><code>HAS_UNION_SEMUN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>union semun</code> is defined by including <i>sys/sem.h</i>. If not, the user code probably needs to define it as:</p>

<pre><code>union semun {
int val;
struct semid_ds *buf;
unsigned short *array;
}</code></pre>

</dd>
</dl>

<dl>

<dt id="I_DIRENT"><a class="permalink" href="perlapi.html#I_DIRENT">#</a><code>I_DIRENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>dirent.h</i>. Using this symbol also triggers the definition of the <code>Direntry_t</code> define which ends up being &#39;<code>struct dirent</code>&#39; or &#39;<code>struct direct</code>&#39; depending on the availability of <i>dirent.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_DIRENT
    #include &lt;dirent.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_POLL"><a class="permalink" href="perlapi.html#I_POLL">#</a><code>I_POLL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>poll.h</i> exists and should be included. (see also <code><a href="perlapi.html#HAS_POLL">&quot;HAS_POLL&quot;</a></code>)</p>

<ul>

<pre><code class="plaintext">#ifdef I_POLL
    #include &lt;poll.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_RESOURCE"><a class="permalink" href="perlapi.html#I_SYS_RESOURCE">#</a><code>I_SYS_RESOURCE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>sys/resource.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_RESOURCE
    #include &lt;sys_resource.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LIBM_LIB_VERSION"><a class="permalink" href="perlapi.html#LIBM_LIB_VERSION">#</a><code>LIBM_LIB_VERSION</code> </dt>
<dd>

<p>This symbol, if defined, indicates that libm exports <code>_LIB_VERSION</code> and that <i>math.h</i> defines the enum to manipulate it.</p>

</dd>
</dl>

<dl>

<dt id="NEED_VA_COPY"><a class="permalink" href="perlapi.html#NEED_VA_COPY">#</a><code>NEED_VA_COPY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system stores the variable argument list datatype, <code>va_list</code>, in a format that cannot be copied by simple assignment, so that some other means must be used when copying is required. As such systems vary in their provision (or non-provision) of copying mechanisms, <i>handy.h</i> defines a platform- independent macro, <code>Perl_va_copy(src, dst)</code>, to do the job.</p>

</dd>
</dl>

<dl>

<dt id="OSNAME"><a class="permalink" href="perlapi.html#OSNAME">#</a><code>OSNAME</code> </dt>
<dd>

<p>This symbol contains the name of the operating system, as determined by Configure. You shouldn&#39;t rely on it too much; the specific feature tests from Configure are generally more reliable.</p>

</dd>
</dl>

<dl>

<dt id="OSVERS"><a class="permalink" href="perlapi.html#OSVERS">#</a><code>OSVERS</code> </dt>
<dd>

<p>This symbol contains the version of the operating system, as determined by Configure. You shouldn&#39;t rely on it too much; the specific feature tests from Configure are generally more reliable.</p>

</dd>
</dl>

<dl>

<dt id="PHOSTNAME"><a class="permalink" href="perlapi.html#PHOSTNAME">#</a><code>PHOSTNAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates the command to feed to the <code>popen()</code> routine to derive the host name. See also <code><a href="perlapi.html#HAS_GETHOSTNAME">&quot;HAS_GETHOSTNAME&quot;</a></code> and <code><a href="perlapi.html#HAS_UNAME">&quot;HAS_UNAME&quot;</a></code>. Note that the command uses a fully qualified path, so that it is safe even if used by a process with super-user privileges.</p>

</dd>
</dl>

<dl>

<dt id="PROCSELFEXE_PATH"><a class="permalink" href="perlapi.html#PROCSELFEXE_PATH">#</a><code>PROCSELFEXE_PATH</code> </dt>
<dd>

<p>If <code>HAS_PROCSELFEXE</code> is defined this symbol is the filename of the symbolic link pointing to the absolute pathname of the executing program.</p>

</dd>
</dl>

<dl>

<dt id="PTRSIZE"><a class="permalink" href="perlapi.html#PTRSIZE">#</a><code>PTRSIZE</code> </dt>
<dd>

<p>This symbol contains the size of a pointer, so that the C preprocessor can make decisions based on it. It will be <code>sizeof(void *)</code> if the compiler supports (void *); otherwise it will be <code>sizeof(char *)</code>.</p>

</dd>
</dl>

<dl>

<dt id="RANDBITS"><a class="permalink" href="perlapi.html#RANDBITS">#</a><code>RANDBITS</code> </dt>
<dd>

<p>This symbol indicates how many bits are produced by the function used to generate normalized random numbers. Values include 15, 16, 31, and 48.</p>

</dd>
</dl>

<dl>

<dt id="SELECT_MIN_BITS"><a class="permalink" href="perlapi.html#SELECT_MIN_BITS">#</a><code>SELECT_MIN_BITS</code> </dt>
<dd>

<p>This symbol holds the minimum number of bits operated by select. That is, if you do <code>select(n, ...)</code>, how many bits at least will be cleared in the masks if some activity is detected. Usually this is either n or 32*<code>ceil(n/32)</code>, especially many little-endians do the latter. This is only useful if you have <code>select()</code>, naturally.</p>

</dd>
</dl>

<dl>

<dt id="SETUID_SCRIPTS_ARE_SECURE_NOW"><a class="permalink" href="perlapi.html#SETUID_SCRIPTS_ARE_SECURE_NOW">#</a><code>SETUID_SCRIPTS_ARE_SECURE_NOW</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the bug that prevents setuid scripts from being secure is not present in this kernel.</p>

</dd>
</dl>

<h2 id="List-of-capability-HAS_foo-symbols"><a class="permalink" href="perlapi.html#List-of-capability-HAS_foo-symbols">#</a><a id="List"></a>List of capability <code>HAS_<i>foo</i></code> symbols</h2>

<p>This is a list of those symbols that dont appear elsewhere in ths document that indicate if the current platform has a certain capability. Their names all begin with <code>HAS_</code>. Only those symbols whose capability is directly derived from the name are listed here. All others have their meaning expanded out elsewhere in this document. This (relatively) compact list is because we think that the expansion would add little or no value and take up a lot of space (because there are so many). If you think certain ones should be expanded, send email to <a href="mailto:perl5-porters@perl.org">perl5-porters@perl.org</a>.</p>

<p>Each symbol here will be <code>#define</code>d if and only if the platform has the capability. If you need more detail, see the corresponding entry in <i>config.h</i>. For convenience, the list is split so that the ones that indicate there is a reentrant version of a capability are listed separately</p>

<p><code>HAS_ACCEPT4</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ACCESS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ACCESSX</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ACOSH</code>,<span style="white-space: nowrap;"> </span> <code>HAS_AINTL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ALARM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ASINH</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ATANH</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ATOLL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CBRT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CHOWN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CHROOT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CHSIZE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CLEARENV</code>,<span style="white-space: nowrap;"> </span> <code>HAS_COPYSIGN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_COPYSIGNL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CRYPT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CTERMID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CUSERID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_DIRFD</code>,<span style="white-space: nowrap;"> </span> <code>HAS_DLADDR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_DLERROR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_EACCESS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDHOSTENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDNETENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDPROTOENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDSERVENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ERF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ERFC</code>,<span style="white-space: nowrap;"> </span> <code>HAS_EXP2</code>,<span style="white-space: nowrap;"> </span> <code>HAS_EXPM1</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FCHMOD</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FCHMODAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FCHOWN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FDIM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FD_SET</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FEGETROUND</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FGETPOS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FLOCK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FMA</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FMAX</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FMIN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FORK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FSEEKO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FSETPOS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FSYNC</code>,<span style="white-space: nowrap;"> </span> <code>HAS_FTELLO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GAI_STRERROR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETADDRINFO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETCWD</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETESPWNAM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETGROUPS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTBYADDR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTBYNAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETLOGIN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNAMEINFO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETBYADDR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETBYNAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPAGESIZE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPGID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPGRP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPGRP2</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPPID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPRIORITY</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOBYNAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOBYNUMBER</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPRPWNAM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVBYNAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVBYPORT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSPNAM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_HTONL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_HTONS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_HYPOT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ILOGBL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_INETNTOP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_INETPTON</code>,<span style="white-space: nowrap;"> </span> <code>HAS_INET_ATON</code>,<span style="white-space: nowrap;"> </span> <code>HAS_IPV6_MREQ</code>,<span style="white-space: nowrap;"> </span> <code>HAS_IPV6_MREQ_SOURCE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_IP_MREQ</code>,<span style="white-space: nowrap;"> </span> <code>HAS_IP_MREQ_SOURCE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ISASCII</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ISBLANK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ISLESS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_KILLPG</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LCHOWN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LINK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LINKAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LLROUND</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LOCKF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LOG1P</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LOG2</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LOGB</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LROUND</code>,<span style="white-space: nowrap;"> </span> <code>HAS_LSTAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MADVISE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MBLEN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MBRLEN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MBRTOWC</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MBSTOWCS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MBTOWC</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MEMMEM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MEMRCHR</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MKDTEMP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MKFIFO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MKOSTEMP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MKSTEMP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MKSTEMPS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MMAP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MPROTECT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MSG</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MSYNC</code>,<span style="white-space: nowrap;"> </span> <code>HAS_MUNMAP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_NEARBYINT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_NEXTAFTER</code>,<span style="white-space: nowrap;"> </span> <code>HAS_NICE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_NTOHL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_NTOHS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PATHCONF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PAUSE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PHOSTNAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PIPE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PIPE2</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PRCTL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_PTRDIFF_T</code>,<span style="white-space: nowrap;"> </span> <code>HAS_READLINK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_READV</code>,<span style="white-space: nowrap;"> </span> <code>HAS_RECVMSG</code>,<span style="white-space: nowrap;"> </span> <code>HAS_REMQUO</code>,<span style="white-space: nowrap;"> </span> <code>HAS_RENAME</code>,<span style="white-space: nowrap;"> </span> <code>HAS_RENAMEAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_RINT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ROUND</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SCALBNL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SEM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SENDMSG</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETEGID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETEUID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETGROUPS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETHOSTENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETLINEBUF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETNETENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPGRP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPGRP2</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPRIORITY</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPROCTITLE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPROTOENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETREGID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETRESGID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETRESUID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETREUID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETRGID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETRUID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETSERVENT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETSID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SHM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SIGACTION</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SIGPROCMASK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SIN6_SCOPE_ID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SNPRINTF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRCOLL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRERROR_L</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRLCAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRLCPY</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRNLEN</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOD</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOLL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOQ</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOUL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOULL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRTOUQ</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRXFRM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SYMLINK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SYSCALL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SYSCONF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SYSTEM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SYS_ERRLIST</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TCGETPGRP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TCSETPGRP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TOWLOWER</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TOWUPPER</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TRUNCATE</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TRUNCL</code>,<span style="white-space: nowrap;"> </span> <code>HAS_UALARM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_UMASK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_UNLINKAT</code>,<span style="white-space: nowrap;"> </span> <code>HAS_UNSETENV</code>,<span style="white-space: nowrap;"> </span> <code>HAS_VFORK</code>,<span style="white-space: nowrap;"> </span> <code>HAS_VSNPRINTF</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WAIT4</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WAITPID</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WCRTOMB</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WCSCMP</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WCSTOMBS</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WCSXFRM</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WCTOMB</code>,<span style="white-space: nowrap;"> </span> <code>HAS_WRITEV</code>,<span style="white-space: nowrap;"> </span> <code>HAS__FWALK</code></p>

<p>And, the reentrant capabilities:</p>

<p><code>HAS_CRYPT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_CTERMID_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_DRAND48_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDHOSTENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDNETENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDPROTOENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_ENDSERVENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETGRGID_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETGRNAM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTBYADDR_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTBYNAME_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETHOSTENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETLOGIN_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETBYADDR_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETBYNAME_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETNETENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOBYNAME_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOBYNUMBER_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPROTOENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPWNAM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETPWUID_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVBYNAME_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVBYPORT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSERVENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_GETSPNAM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_RANDOM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_READDIR_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETHOSTENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETNETENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETPROTOENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SETSERVENT_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SRAND48_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_SRANDOM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_STRERROR_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TMPNAM_R</code>,<span style="white-space: nowrap;"> </span> <code>HAS_TTYNAME_R</code></p>

<p>Example usage:</p>

<ul>

<pre><code class="plaintext">#ifdef HAS_STRNLEN
  use strnlen()
#else
  use an alternative implementation
#endif</code></pre>

</ul>

<h2 id="List-of-#include-needed-symbols"><a class="permalink" href="perlapi.html#List-of-%23include-needed-symbols">#</a><a id="List1"></a><a id="List-of-include-needed-symbols"></a>List of <code>#include</code> needed symbols</h2>

<p>This list contains symbols that indicate if certain <code>#include</code> files are present on the platform. If your code accesses the functionality that one of these is for, you will need to <code>#include</code> it if the symbol on this list is <code>#define</code>d. For more detail, see the corresponding entry in <i>config.h</i>.</p>

<p><code>I_ARPA_INET</code>,<span style="white-space: nowrap;"> </span> <code>I_BFD</code>,<span style="white-space: nowrap;"> </span> <code>I_CRYPT</code>,<span style="white-space: nowrap;"> </span> <code>I_DBM</code>,<span style="white-space: nowrap;"> </span> <code>I_DLFCN</code>,<span style="white-space: nowrap;"> </span> <code>I_EXECINFO</code>,<span style="white-space: nowrap;"> </span> <code>I_FP</code>,<span style="white-space: nowrap;"> </span> <code>I_FP_CLASS</code>,<span style="white-space: nowrap;"> </span> <code>I_GDBM</code>,<span style="white-space: nowrap;"> </span> <code>I_GDBMNDBM</code>,<span style="white-space: nowrap;"> </span> <code>I_GDBM_NDBM</code>,<span style="white-space: nowrap;"> </span> <code>I_GRP</code>,<span style="white-space: nowrap;"> </span> <code>I_IEEEFP</code>,<span style="white-space: nowrap;"> </span> <code>I_INTTYPES</code>,<span style="white-space: nowrap;"> </span> <code>I_LIBUTIL</code>,<span style="white-space: nowrap;"> </span> <code>I_MNTENT</code>,<span style="white-space: nowrap;"> </span> <code>I_NDBM</code>,<span style="white-space: nowrap;"> </span> <code>I_NETDB</code>,<span style="white-space: nowrap;"> </span> <code>I_NETINET_IN</code>,<span style="white-space: nowrap;"> </span> <code>I_NETINET_TCP</code>,<span style="white-space: nowrap;"> </span> <code>I_NET_ERRNO</code>,<span style="white-space: nowrap;"> </span> <code>I_PROT</code>,<span style="white-space: nowrap;"> </span> <code>I_PWD</code>,<span style="white-space: nowrap;"> </span> <code>I_RPCSVC_DBM</code>,<span style="white-space: nowrap;"> </span> <code>I_SGTTY</code>,<span style="white-space: nowrap;"> </span> <code>I_SHADOW</code>,<span style="white-space: nowrap;"> </span> <code>I_STDBOOL</code>,<span style="white-space: nowrap;"> </span> <code>I_STDINT</code>,<span style="white-space: nowrap;"> </span> <code>I_SUNMATH</code>,<span style="white-space: nowrap;"> </span> <code>I_SYSLOG</code>,<span style="white-space: nowrap;"> </span> <code>I_SYSMODE</code>,<span style="white-space: nowrap;"> </span> <code>I_SYSUIO</code>,<span style="white-space: nowrap;"> </span> <code>I_SYSUTSNAME</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_ACCESS</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_IOCTL</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_MOUNT</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_PARAM</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_POLL</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_SECURITY</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_SELECT</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_STAT</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_STATVFS</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_TIME</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_TIMES</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_TIME_KERNEL</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_TYPES</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_UN</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_VFS</code>,<span style="white-space: nowrap;"> </span> <code>I_SYS_WAIT</code>,<span style="white-space: nowrap;"> </span> <code>I_TERMIO</code>,<span style="white-space: nowrap;"> </span> <code>I_TERMIOS</code>,<span style="white-space: nowrap;"> </span> <code>I_UNISTD</code>,<span style="white-space: nowrap;"> </span> <code>I_USTAT</code>,<span style="white-space: nowrap;"> </span> <code>I_VFORK</code>,<span style="white-space: nowrap;"> </span> <code>I_WCHAR</code>,<span style="white-space: nowrap;"> </span> <code>I_WCTYPE</code></p>

<p>Example usage:</p>

<ul>

<pre><code class="plaintext">#ifdef I_WCHAR
  #include &lt;wchar.h&gt;
#endif</code></pre>

</ul>

<h1 id="Global-Variables"><a class="permalink" href="perlapi.html#Global-Variables">#</a><a id="Global"></a>Global Variables</h1>

<p>These variables are global to an entire process. They are shared between all interpreters and all threads in a process. Any variables not documented here may be changed or removed without notice, so don&#39;t use them! If you feel you really do need to use an unlisted variable, first send email to <a href="mailto:perl5-porters@perl.org">perl5-porters@perl.org</a>. It may be that someone there will point out a way to accomplish what you need without using an internal variable. But if not, you should get a go-ahead to document and then use the variable.</p>

<dl>

<dt id="PL_check"><a class="permalink" href="perlapi.html#PL_check">#</a><code>PL_check</code> </dt>
<dd>

<p>Array, indexed by opcode, of functions that will be called for the &quot;check&quot; phase of optree building during compilation of Perl code. For most (but not all) types of op, once the op has been initially built and populated with child ops it will be filtered through the check function referenced by the appropriate element of this array. The new op is passed in as the sole argument to the check function, and the check function returns the completed op. The check function may (as the name suggests) check the op for validity and signal errors. It may also initialise or modify parts of the ops, or perform more radical surgery such as adding or removing child ops, or even throw the op away and return a different op in its place.</p>

<p>This array of function pointers is a convenient place to hook into the compilation process. An XS module can put its own custom check function in place of any of the standard ones, to influence the compilation of a particular type of op. However, a custom check function must never fully replace a standard check function (or even a custom check function from another module). A module modifying checking must instead <b>wrap</b> the preexisting check function. A custom check function must be selective about when to apply its custom behaviour. In the usual case where it decides not to do anything special with an op, it must chain the preexisting op function. Check functions are thus linked in a chain, with the core&#39;s base checker at the end.</p>

<p>For thread safety, modules should not write directly to this array. Instead, use the function <a href="perlapi.html#wrap_op_checker">&quot;wrap_op_checker&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="PL_keyword_plugin"><a class="permalink" href="perlapi.html#PL_keyword_plugin">#</a><code>PL_keyword_plugin</code> </dt>
<dd>

<p>NOTE: <code>PL_keyword_plugin</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Function pointer, pointing at a function used to handle extended keywords. The function should be declared as</p>

<pre><code class="plaintext">int keyword_plugin_function(pTHX_
        char *keyword_ptr, STRLEN keyword_len,
        OP **op_ptr)</code></pre>

<p>The function is called from the tokeniser, whenever a possible keyword is seen. <code>keyword_ptr</code> points at the word in the parser&#39;s input buffer, and <code>keyword_len</code> gives its length; it is not null-terminated. The function is expected to examine the word, and possibly other state such as <a href="perlvar.html#%25%5EH">%^H</a>, to decide whether it wants to handle it as an extended keyword. If it does not, the function should return <code>KEYWORD_PLUGIN_DECLINE</code>, and the normal parser process will continue.</p>

<p>If the function wants to handle the keyword, it first must parse anything following the keyword that is part of the syntax introduced by the keyword. See <a href="perlapi.html#Lexer-interface">&quot;Lexer interface&quot;</a> for details.</p>

<p>When a keyword is being handled, the plugin function must build a tree of <code>OP</code> structures, representing the code that was parsed. The root of the tree must be stored in <code>*op_ptr</code>. The function then returns a constant indicating the syntactic role of the construct that it has parsed: <code>KEYWORD_PLUGIN_STMT</code> if it is a complete statement, or <code>KEYWORD_PLUGIN_EXPR</code> if it is an expression. Note that a statement construct cannot be used inside an expression (except via <code>do BLOCK</code> and similar), and an expression is not a complete statement (it requires at least a terminating semicolon).</p>

<p>When a keyword is handled, the plugin function may also have (compile-time) side effects. It may modify <code>%^H</code>, define functions, and so on. Typically, if side effects are the main purpose of a handler, it does not wish to generate any ops to be included in the normal compilation. In this case it is still required to supply an op tree, but it suffices to generate a single null op.</p>

<p>That&#39;s how the <code>*PL_keyword_plugin</code> function needs to behave overall. Conventionally, however, one does not completely replace the existing handler function. Instead, take a copy of <code>PL_keyword_plugin</code> before assigning your own function pointer to it. Your handler function should look for keywords that it is interested in and handle those. Where it is not interested, it should call the saved plugin function, passing on the arguments it received. Thus <code>PL_keyword_plugin</code> actually points at a chain of handler functions, all of which have an opportunity to handle keywords, and only the last function in the chain (built into the Perl core) will normally return <code>KEYWORD_PLUGIN_DECLINE</code>.</p>

<p>For thread safety, modules should not set this variable directly. Instead, use the function <a href="perlapi.html#wrap_keyword_plugin">&quot;wrap_keyword_plugin&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="PL_phase"><a class="permalink" href="perlapi.html#PL_phase">#</a><code>PL_phase</code> </dt>
<dd>

<p>A value that indicates the current Perl interpreter&#39;s phase. Possible values include <code>PERL_PHASE_CONSTRUCT</code>, <code>PERL_PHASE_START</code>, <code>PERL_PHASE_CHECK</code>, <code>PERL_PHASE_INIT</code>, <code>PERL_PHASE_RUN</code>, <code>PERL_PHASE_END</code>, and <code>PERL_PHASE_DESTRUCT</code>.</p>

<p>For example, the following determines whether the interpreter is in global destruction:</p>

<pre><code>if (PL_phase == PERL_PHASE_DESTRUCT) {
    // we are in global destruction
}</code></pre>

<p><code>PL_phase</code> was introduced in Perl 5.14; in prior perls you can use <code>PL_dirty</code> (boolean) to determine whether the interpreter is in global destruction. (Use of <code>PL_dirty</code> is discouraged since 5.14.)</p>

<ul>

<pre><code class="plaintext">enum perl_phase  PL_phase</code></pre>

</ul>

</dd>
</dl>

<h1 id="GV-Handling"><a class="permalink" href="perlapi.html#GV-Handling">#</a><a id="GV"></a>GV Handling</h1>

<p>A GV is a structure which corresponds to to a Perl typeglob, ie *foo. It is a structure that holds a pointer to a scalar, an array, a hash etc, corresponding to $foo, @foo, %foo.</p>

<p>GVs are usually found as values in stashes (symbol table hashes) where Perl stores its global variables.</p>

<dl>

<dt id="gv_autoload4"><a class="permalink" href="perlapi.html#gv_autoload4">#</a><code>gv_autoload4</code> </dt>
<dd>

<p>Equivalent to <code><a href="perlapi.html#gv_autoload_pvn">&quot;gv_autoload_pvn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">GV*  gv_autoload4(HV* stash, const char* name, STRLEN len,
                  I32 method)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GvAV"><a class="permalink" href="perlapi.html#GvAV">#</a><code>GvAV</code> </dt>
<dd>

<p>Return the AV from the GV.</p>

<ul>

<pre><code class="plaintext">AV*  GvAV(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_const_sv"><a class="permalink" href="perlapi.html#gv_const_sv">#</a><code>gv_const_sv</code> </dt>
<dd>

<p>If <code>gv</code> is a typeglob whose subroutine entry is a constant sub eligible for inlining, or <code>gv</code> is a placeholder reference that would be promoted to such a typeglob, then returns the value returned by the sub. Otherwise, returns <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">SV*  gv_const_sv(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GvCV"><a class="permalink" href="perlapi.html#GvCV">#</a><code>GvCV</code> </dt>
<dd>

<p>Return the CV from the GV.</p>

<ul>

<pre><code class="plaintext">CV*  GvCV(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchfile"><a class="permalink" href="perlapi.html#gv_fetchfile">#</a><code>gv_fetchfile</code></dt>
<dd>

</dd>
<dt id="gv_fetchfile_flags"><a class="permalink" href="perlapi.html#gv_fetchfile_flags">#</a><code>gv_fetchfile_flags</code> </dt>
<dd>

<p>These return the debugger glob for the file (compiled by Perl) whose name is given by the <code>name</code> parameter.</p>

<p>There are currently exactly two differences between these functions.</p>

<p>The <code>name</code> parameter to <code>gv_fetchfile</code> is a C string, meaning it is <code>NUL</code>-terminated; whereas the <code>name</code> parameter to <code>gv_fetchfile_flags</code> is a Perl string, whose length (in bytes) is passed in via the <code>namelen</code> parameter This means the name may contain embedded <code>NUL</code> characters. <code>namelen</code> doesn&#39;t exist in plain <code>gv_fetchfile</code>).</p>

<p>The other difference is that <code>gv_fetchfile_flags</code> has an extra <code>flags</code> parameter, which is currently completely ignored, but allows for possible future extensions.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchfile      (const char* name)
GV*  gv_fetchfile_flags(const char *const name, const STRLEN len,
                        const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth"><a class="permalink" href="perlapi.html#gv_fetchmeth">#</a><code>gv_fetchmeth</code> </dt>
<dd>

<p>Like <a href="perlapi.html#gv_fetchmeth_pvn">&quot;gv_fetchmeth_pvn&quot;</a>, but lacks a flags parameter.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth(HV* stash, const char* name, STRLEN len,
                  I32 level)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmethod"><a class="permalink" href="perlapi.html#gv_fetchmethod">#</a><code>gv_fetchmethod</code> </dt>
<dd>

<p>See <a href="perlapi.html#gv_fetchmethod_autoload">&quot;gv_fetchmethod_autoload&quot;</a>.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmethod(HV* stash, const char* name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmethod_autoload"><a class="permalink" href="perlapi.html#gv_fetchmethod_autoload">#</a><code>gv_fetchmethod_autoload</code> </dt>
<dd>

<p>Returns the glob which contains the subroutine to call to invoke the method on the <code>stash</code>. In fact in the presence of autoloading this may be the glob for &quot;AUTOLOAD&quot;. In this case the corresponding variable <code>$AUTOLOAD</code> is already setup.</p>

<p>The third parameter of <code>gv_fetchmethod_autoload</code> determines whether AUTOLOAD lookup is performed if the given method is not present: non-zero means yes, look for AUTOLOAD; zero means no, don&#39;t look for AUTOLOAD. Calling <code>gv_fetchmethod</code> is equivalent to calling <code>gv_fetchmethod_autoload</code> with a non-zero <code>autoload</code> parameter.</p>

<p>These functions grant <code>&quot;SUPER&quot;</code> token as a prefix of the method name. Note that if you want to keep the returned glob for a long time, you need to check for it being &quot;AUTOLOAD&quot;, since at the later time the call may load a different subroutine due to <code>$AUTOLOAD</code> changing its value. Use the glob created as a side effect to do this.</p>

<p>These functions have the same side-effects as <code>gv_fetchmeth</code> with <code>level==0</code>. The warning against passing the GV returned by <code>gv_fetchmeth</code> to <code>call_sv</code> applies equally to these functions.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmethod_autoload(HV* stash, const char* name,
                             I32 autoload)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_autoload"><a class="permalink" href="perlapi.html#gv_fetchmeth_autoload">#</a><code>gv_fetchmeth_autoload</code> </dt>
<dd>

<p>This is the old form of <a href="perlapi.html#gv_fetchmeth_pvn_autoload">&quot;gv_fetchmeth_pvn_autoload&quot;</a>, which has no flags parameter.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_autoload(HV* stash, const char* name,
                           STRLEN len, I32 level)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_pv"><a class="permalink" href="perlapi.html#gv_fetchmeth_pv">#</a><code>gv_fetchmeth_pv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#gv_fetchmeth_pvn">&quot;gv_fetchmeth_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_pv(HV* stash, const char* name, I32 level,
                     U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_pvn"><a class="permalink" href="perlapi.html#gv_fetchmeth_pvn">#</a><code>gv_fetchmeth_pvn</code> </dt>
<dd>

<p>Returns the glob with the given <code>name</code> and a defined subroutine or <code>NULL</code>. The glob lives in the given <code>stash</code>, or in the stashes accessible via <code>@ISA</code> and <code>UNIVERSAL::</code>.</p>

<p>The argument <code>level</code> should be either 0 or -1. If <code>level==0</code>, as a side-effect creates a glob with the given <code>name</code> in the given <code>stash</code> which in the case of success contains an alias for the subroutine, and sets up caching info for this glob.</p>

<p>The only significant values for <code>flags</code> are <code>GV_SUPER</code>, <code>GV_NOUNIVERSAL</code>, and <code>SVf_UTF8</code>.</p>

<p><code>GV_SUPER</code> indicates that we want to look up the method in the superclasses of the <code>stash</code>.</p>

<p><code>GV_NOUNIVERSAL</code> indicates that we do not want to look up the method in the stash accessible by <code>UNIVERSAL::</code>.</p>

<p>The GV returned from <code>gv_fetchmeth</code> may be a method cache entry, which is not visible to Perl code. So when calling <code>call_sv</code>, you should not use the GV directly; instead, you should use the method&#39;s CV, which can be obtained from the GV with the <code>GvCV</code> macro.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_pvn(HV* stash, const char* name, STRLEN len,
                      I32 level, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_pvn_autoload"><a class="permalink" href="perlapi.html#gv_fetchmeth_pvn_autoload">#</a><code>gv_fetchmeth_pvn_autoload</code> </dt>
<dd>

<p>Same as <code>gv_fetchmeth_pvn()</code>, but looks for autoloaded subroutines too. Returns a glob for the subroutine.</p>

<p>For an autoloaded subroutine without a GV, will create a GV even if <code>level &lt; 0</code>. For an autoloaded subroutine without a stub, <code>GvCV()</code> of the result may be zero.</p>

<p>Currently, the only significant value for <code>flags</code> is <code>SVf_UTF8</code>.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_pvn_autoload(HV* stash, const char* name,
                               STRLEN len, I32 level, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_pv_autoload"><a class="permalink" href="perlapi.html#gv_fetchmeth_pv_autoload">#</a><code>gv_fetchmeth_pv_autoload</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#gv_fetchmeth_pvn_autoload">&quot;gv_fetchmeth_pvn_autoload&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_pv_autoload(HV* stash, const char* name,
                              I32 level, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_sv"><a class="permalink" href="perlapi.html#gv_fetchmeth_sv">#</a><code>gv_fetchmeth_sv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#gv_fetchmeth_pvn">&quot;gv_fetchmeth_pvn&quot;</a>, but takes the name string in the form of an SV instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_sv(HV* stash, SV* namesv, I32 level, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchmeth_sv_autoload"><a class="permalink" href="perlapi.html#gv_fetchmeth_sv_autoload">#</a><code>gv_fetchmeth_sv_autoload</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#gv_fetchmeth_pvn_autoload">&quot;gv_fetchmeth_pvn_autoload&quot;</a>, but takes the name string in the form of an SV instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">GV*  gv_fetchmeth_sv_autoload(HV* stash, SV* namesv, I32 level,
                              U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_fetchpv"><a class="permalink" href="perlapi.html#gv_fetchpv">#</a><code>gv_fetchpv</code></dt>
<dd>

</dd>
<dt id="gv_fetchpvn"><a class="permalink" href="perlapi.html#gv_fetchpvn">#</a><code>gv_fetchpvn</code></dt>
<dd>

</dd>
<dt id="gv_fetchpvn_flags"><a class="permalink" href="perlapi.html#gv_fetchpvn_flags">#</a><code>gv_fetchpvn_flags</code></dt>
<dd>

</dd>
<dt id="gv_fetchpvs"><a class="permalink" href="perlapi.html#gv_fetchpvs">#</a><code>gv_fetchpvs</code></dt>
<dd>

</dd>
<dt id="gv_fetchsv"><a class="permalink" href="perlapi.html#gv_fetchsv">#</a><code>gv_fetchsv</code></dt>
<dd>

</dd>
<dt id="gv_fetchsv_nomg"><a class="permalink" href="perlapi.html#gv_fetchsv_nomg">#</a><code>gv_fetchsv_nomg</code> </dt>
<dd>

<p>These all return the GV of type <code>sv_type</code> whose name is given by the inputs, or NULL if no GV of that name and type could be found. See <a href="perlguts.html#Stashes-and-Globs">&quot;Stashes and Globs&quot; in perlguts</a>.</p>

<p>The only differences are how the input name is specified, and if &#39;get&#39; magic is normally used in getting that name.</p>

<p>Don&#39;t be fooled by the fact that only one form has <code>flags</code> in its name. They all have a <code>flags</code> parameter in fact, and all the flag bits have the same meanings for all</p>

<p>If any of the flags <code>GV_ADD</code>, <code>GV_ADDMG</code>, <code>GV_ADDWARN</code>, <code>GV_ADDMULTI</code>, or <code>GV_NOINIT</code> is set, a GV is created if none already exists for the input name and type. However, <code>GV_ADDMG</code> will only do the creation for magical GV&#39;s. For all of these flags except <code>GV_NOINIT</code>, <code><a href="perlapi.html#gv_init_pvn">&quot;gv_init_pvn&quot;</a></code> is called after the addition. <code>GV_ADDWARN</code> is used when the caller expects that adding won&#39;t be necessary because the symbol should already exist; but if not, add it anyway, with a warning that it was unexpectedly absent. The <code>GV_ADDMULTI</code> flag means to pretend that the GV has been seen before (<i>i.e.</i>, suppress &quot;Used once&quot; warnings).</p>

<p>The flag <code>GV_NOADD_NOINIT</code> causes <code><a href="perlapi.html#gv_init_pvn">&quot;gv_init_pvn&quot;</a></code> not be to called if the GV existed but isn&#39;t PVGV.</p>

<p>If the <code>SVf_UTF8</code> bit is set, the name is treated as being encoded in UTF-8; otherwise the name won&#39;t be considered to be UTF-8 in the <code>pv</code>-named forms, and the UTF-8ness of the underlying SVs will be used in the <code>sv</code> forms.</p>

<p>If the flag <code>GV_NOTQUAL</code> is set, the caller warrants that the input name is a plain symbol name, not qualified with a package, otherwise the name is checked for being a qualified one.</p>

<p>In <code>gv_fetchpv</code>, <code>nambeg</code> is a C string, NUL-terminated with no intermediate NULs.</p>

<p>In <code>gv_fetchpvs</code>, <code>name</code> is a literal C string, hence is enclosed in double quotes.</p>

<p><code>gv_fetchpvn</code> and <code>gv_fetchpvn_flags</code> are identical. In these, &lt;nambeg&gt; is a Perl string whose byte length is given by <code>full_len</code>, and may contain embedded NULs.</p>

<p>In <code>gv_fetchsv</code> and <code>gv_fetchsv_nomg</code>, the name is extracted from the PV of the input <code>name</code> SV. The only difference between these two forms is that &#39;get&#39; magic is normally done on <code>name</code> in <code>gv_fetchsv</code>, and always skipped with <code>gv_fetchsv_nomg</code>. Including <code>GV_NO_SVGMAGIC</code> in the <code>flags</code> parameter to <code>gv_fetchsv</code> makes it behave identically to <code>gv_fetchsv_nomg</code>.</p>

<ul>

<pre><code class="plaintext">GV*   gv_fetchpv       (const char *nambeg, I32 flags,
                        const svtype sv_type)
GV *  gv_fetchpvn      (const char * nambeg, STRLEN full_len,
                        I32 flags, const svtype sv_type)
GV*   gv_fetchpvn_flags(const char* name, STRLEN len, I32 flags,
                        const svtype sv_type)
GV *  gv_fetchpvs      (&quot;name&quot;, I32 flags, const svtype sv_type)
GV*   gv_fetchsv       (SV *name, I32 flags, const svtype sv_type)
GV *  gv_fetchsv_nomg  (SV *name, I32 flags, const svtype sv_type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GvHV"><a class="permalink" href="perlapi.html#GvHV">#</a><code>GvHV</code> </dt>
<dd>

<p>Return the HV from the GV.</p>

<ul>

<pre><code class="plaintext">HV*  GvHV(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_init"><a class="permalink" href="perlapi.html#gv_init">#</a><code>gv_init</code> </dt>
<dd>

<p>The old form of <code>gv_init_pvn()</code>. It does not work with UTF-8 strings, as it has no flags parameter. If the <code>multi</code> parameter is set, the <code>GV_ADDMULTI</code> flag will be passed to <code>gv_init_pvn()</code>.</p>

<ul>

<pre><code class="plaintext">void  gv_init(GV* gv, HV* stash, const char* name, STRLEN len,
              int multi)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_init_pv"><a class="permalink" href="perlapi.html#gv_init_pv">#</a><code>gv_init_pv</code> </dt>
<dd>

<p>Same as <code>gv_init_pvn()</code>, but takes a nul-terminated string for the name instead of separate char * and length parameters.</p>

<ul>

<pre><code class="plaintext">void  gv_init_pv(GV* gv, HV* stash, const char* name, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_init_pvn"><a class="permalink" href="perlapi.html#gv_init_pvn">#</a><code>gv_init_pvn</code> </dt>
<dd>

<p>Converts a scalar into a typeglob. This is an incoercible typeglob; assigning a reference to it will assign to one of its slots, instead of overwriting it as happens with typeglobs created by <code>SvSetSV</code>. Converting any scalar that is <code>SvOK()</code> may produce unpredictable results and is reserved for perl&#39;s internal use.</p>

<p><code>gv</code> is the scalar to be converted.</p>

<p><code>stash</code> is the parent stash/package, if any.</p>

<p><code>name</code> and <code>len</code> give the name. The name must be unqualified; that is, it must not include the package name. If <code>gv</code> is a stash element, it is the caller&#39;s responsibility to ensure that the name passed to this function matches the name of the element. If it does not match, perl&#39;s internal bookkeeping will get out of sync.</p>

<p><code>flags</code> can be set to <code>SVf_UTF8</code> if <code>name</code> is a UTF-8 string, or the return value of SvUTF8(sv). It can also take the <code>GV_ADDMULTI</code> flag, which means to pretend that the GV has been seen before (i.e., suppress &quot;Used once&quot; warnings).</p>

<ul>

<pre><code class="plaintext">void  gv_init_pvn(GV* gv, HV* stash, const char* name, STRLEN len,
                  U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_init_sv"><a class="permalink" href="perlapi.html#gv_init_sv">#</a><code>gv_init_sv</code> </dt>
<dd>

<p>Same as <code>gv_init_pvn()</code>, but takes an SV * for the name instead of separate char * and length parameters. <code>flags</code> is currently unused.</p>

<ul>

<pre><code class="plaintext">void  gv_init_sv(GV* gv, HV* stash, SV* namesv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_stashpv"><a class="permalink" href="perlapi.html#gv_stashpv">#</a><code>gv_stashpv</code> </dt>
<dd>

<p>Returns a pointer to the stash for a specified package. Uses <code>strlen</code> to determine the length of <code>name</code>, then calls <code>gv_stashpvn()</code>.</p>

<ul>

<pre><code class="plaintext">HV*  gv_stashpv(const char* name, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_stashpvn"><a class="permalink" href="perlapi.html#gv_stashpvn">#</a><code>gv_stashpvn</code> </dt>
<dd>

<p>Returns a pointer to the stash for a specified package. The <code>namelen</code> parameter indicates the length of the <code>name</code>, in bytes. <code>flags</code> is passed to <code>gv_fetchpvn_flags()</code>, so if set to <code>GV_ADD</code> then the package will be created if it does not already exist. If the package does not exist and <code>flags</code> is 0 (or any other setting that does not create packages) then <code>NULL</code> is returned.</p>

<p>Flags may be one of:</p>

<pre><code class="plaintext">GV_ADD           Create and initialize the package if doesn&#39;t
                 already exist
GV_NOADD_NOINIT  Don&#39;t create the package,
GV_ADDMG         GV_ADD iff the GV is magical
GV_NOINIT        GV_ADD, but don&#39;t initialize
GV_NOEXPAND      Don&#39;t expand SvOK() entries to PVGV
SVf_UTF8         The name is in UTF-8</code></pre>

<p>The most important of which are probably <code>GV_ADD</code> and <code>SVf_UTF8</code>.</p>

<p>Note, use of <code>gv_stashsv</code> instead of <code>gv_stashpvn</code> where possible is strongly recommended for performance reasons.</p>

<ul>

<pre><code class="plaintext">HV*  gv_stashpvn(const char* name, U32 namelen, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_stashpvs"><a class="permalink" href="perlapi.html#gv_stashpvs">#</a><code>gv_stashpvs</code> </dt>
<dd>

<p>Like <code>gv_stashpvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">HV*  gv_stashpvs(&quot;name&quot;, I32 create)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="gv_stashsv"><a class="permalink" href="perlapi.html#gv_stashsv">#</a><code>gv_stashsv</code> </dt>
<dd>

<p>Returns a pointer to the stash for a specified package. See <code><a href="perlapi.html#gv_stashpvn">&quot;gv_stashpvn&quot;</a></code>.</p>

<p>Note this interface is strongly preferred over <code>gv_stashpvn</code> for performance reasons.</p>

<ul>

<pre><code class="plaintext">HV*  gv_stashsv(SV* sv, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GvSV"><a class="permalink" href="perlapi.html#GvSV">#</a><code>GvSV</code> </dt>
<dd>

<p>Return the SV from the GV.</p>

<p>Prior to Perl v5.9.3, this would add a scalar if none existed. Nowadays, use <code><a href="perlapi.html#GvSVn">&quot;GvSVn&quot;</a></code> for that, or compile perl with <span style="white-space: nowrap;"><code>-DPERL_CREATE_GVSV</code></span>. See <a href="perl5100delta.html">perl5100delta</a>.</p>

<ul>

<pre><code class="plaintext">SV*  GvSV(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GvSVn"><a class="permalink" href="perlapi.html#GvSVn">#</a><code>GvSVn</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#GvSV">&quot;GvSV&quot;</a></code>, but creates an empty scalar if none already exists.</p>

<ul>

<pre><code class="plaintext">SV*  GvSVn(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_gp"><a class="permalink" href="perlapi.html#save_gp">#</a><code>save_gp</code> </dt>
<dd>

<p>Saves the current GP of gv on the save stack to be restored on scope exit.</p>

<p>If empty is true, replace the GP with a new GP.</p>

<p>If empty is false, mark gv with GVf_INTRO so the next reference assigned is localized, which is how <code> local *foo = $someref; </code> works.</p>

<ul>

<pre><code class="plaintext">void  save_gp(GV* gv, I32 empty)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="setdefout"><a class="permalink" href="perlapi.html#setdefout">#</a><code>setdefout</code> </dt>
<dd>

<p>Sets <code>PL_defoutgv</code>, the default file handle for output, to the passed in typeglob. As <code>PL_defoutgv</code> &quot;owns&quot; a reference on its typeglob, the reference count of the passed in typeglob is increased by one, and the reference count of the typeglob that <code>PL_defoutgv</code> points to is decreased by one.</p>

<ul>

<pre><code class="plaintext">void  setdefout(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Hook-manipulation"><a class="permalink" href="perlapi.html#Hook-manipulation">#</a><a id="Hook"></a>Hook manipulation</h1>

<p>These functions provide convenient and thread-safe means of manipulating hook variables.</p>

<dl>

<dt id="wrap_op_checker"><a class="permalink" href="perlapi.html#wrap_op_checker">#</a><code>wrap_op_checker</code> </dt>
<dd>

<p>Puts a C function into the chain of check functions for a specified op type. This is the preferred way to manipulate the <a href="perlapi.html#PL_check">&quot;PL_check&quot;</a> array. <code>opcode</code> specifies which type of op is to be affected. <code>new_checker</code> is a pointer to the C function that is to be added to that opcode&#39;s check chain, and <code>old_checker_p</code> points to the storage location where a pointer to the next function in the chain will be stored. The value of <code>new_checker</code> is written into the <a href="perlapi.html#PL_check">&quot;PL_check&quot;</a> array, while the value previously stored there is written to <code>*old_checker_p</code>.</p>

<p><a href="perlapi.html#PL_check">&quot;PL_check&quot;</a> is global to an entire process, and a module wishing to hook op checking may find itself invoked more than once per process, typically in different threads. To handle that situation, this function is idempotent. The location <code>*old_checker_p</code> must initially (once per process) contain a null pointer. A C variable of static duration (declared at file scope, typically also marked <code>static</code> to give it internal linkage) will be implicitly initialised appropriately, if it does not have an explicit initialiser. This function will only actually modify the check chain if it finds <code>*old_checker_p</code> to be null. This function is also thread safe on the small scale. It uses appropriate locking to avoid race conditions in accessing <a href="perlapi.html#PL_check">&quot;PL_check&quot;</a>.</p>

<p>When this function is called, the function referenced by <code>new_checker</code> must be ready to be called, except for <code>*old_checker_p</code> being unfilled. In a threading situation, <code>new_checker</code> may be called immediately, even before this function has returned. <code>*old_checker_p</code> will always be appropriately set before <code>new_checker</code> is called. If <code>new_checker</code> decides not to do anything special with an op that it is given (which is the usual case for most uses of op check hooking), it must chain the check function referenced by <code>*old_checker_p</code>.</p>

<p>Taken all together, XS code to hook an op checker should typically look something like this:</p>

<pre><code>    static Perl_check_t nxck_frob;
    static OP *myck_frob(pTHX_ OP *op) {
	...
	op = nxck_frob(aTHX_ op);
	...
	return op;
    }
    BOOT:
	wrap_op_checker(OP_FROB, myck_frob, &amp;nxck_frob);</code></pre>

<p>If you want to influence compilation of calls to a specific subroutine, then use <a href="perlapi.html#cv_set_call_checker_flags">&quot;cv_set_call_checker_flags&quot;</a> rather than hooking checking of all <code>entersub</code> ops.</p>

<ul>

<pre><code class="plaintext">void  wrap_op_checker(Optype opcode, Perl_check_t new_checker,
                      Perl_check_t *old_checker_p)</code></pre>

</ul>

</dd>
</dl>

<h1 id="HV-Handling"><a class="permalink" href="perlapi.html#HV-Handling">#</a><a id="HV1"></a>HV Handling</h1>

<p>A HV structure represents a Perl hash. It consists mainly of an array of pointers, each of which points to a linked list of HE structures. The array is indexed by the hash function of the key, so each linked list represents all the hash entries with the same hash value. Each HE contains a pointer to the actual value, plus a pointer to a HEK structure which holds the key and hash value.</p>

<dl>

<dt id="get_hv"><a class="permalink" href="perlapi.html#get_hv">#</a><code>get_hv</code> </dt>
<dd>

<p>Returns the HV of the specified Perl hash. <code>flags</code> are passed to <code>gv_fetchpv</code>. If <code>GV_ADD</code> is set and the Perl variable does not exist then it will be created. If <code>flags</code> is zero and the variable does not exist then <code>NULL</code> is returned.</p>

<p>NOTE: the <code>perl_get_hv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">HV*  get_hv(const char *name, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HEf_SVKEY"><a class="permalink" href="perlapi.html#HEf_SVKEY">#</a><code>HEf_SVKEY</code> </dt>
<dd>

<p>This flag, used in the length slot of hash entries and magic structures, specifies the structure contains an <code>SV*</code> pointer where a <code>char*</code> pointer is to be expected. (For information only--not to be used).</p>

</dd>
</dl>

<dl>

<dt id="HeHASH"><a class="permalink" href="perlapi.html#HeHASH">#</a><code>HeHASH</code> </dt>
<dd>

<p>Returns the computed hash stored in the hash entry.</p>

<ul>

<pre><code class="plaintext">U32  HeHASH(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeKEY"><a class="permalink" href="perlapi.html#HeKEY">#</a><code>HeKEY</code> </dt>
<dd>

<p>Returns the actual pointer stored in the key slot of the hash entry. The pointer may be either <code>char*</code> or <code>SV*</code>, depending on the value of <code>HeKLEN()</code>. Can be assigned to. The <code>HePV()</code> or <code>HeSVKEY()</code> macros are usually preferable for finding the value of a key.</p>

<ul>

<pre><code class="plaintext">void*  HeKEY(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeKLEN"><a class="permalink" href="perlapi.html#HeKLEN">#</a><code>HeKLEN</code> </dt>
<dd>

<p>If this is negative, and amounts to <code>HEf_SVKEY</code>, it indicates the entry holds an <code>SV*</code> key. Otherwise, holds the actual length of the key. Can be assigned to. The <code>HePV()</code> macro is usually preferable for finding key lengths.</p>

<ul>

<pre><code class="plaintext">STRLEN  HeKLEN(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HePV"><a class="permalink" href="perlapi.html#HePV">#</a><code>HePV</code> </dt>
<dd>

<p>Returns the key slot of the hash entry as a <code>char*</code> value, doing any necessary dereferencing of possibly <code>SV*</code> keys. The length of the string is placed in <code>len</code> (this is a macro, so do <i>not</i> use <code>&amp;len</code>). If you do not care about what the length of the key is, you may use the global variable <code>PL_na</code>, though this is rather less efficient than using a local variable. Remember though, that hash keys in perl are free to contain embedded nulls, so using <code>strlen()</code> or similar is not a good way to find the length of hash keys. This is very similar to the <code>SvPV()</code> macro described elsewhere in this document. See also <code><a href="perlapi.html#HeUTF8">&quot;HeUTF8&quot;</a></code>.</p>

<p>If you are using <code>HePV</code> to get values to pass to <code>newSVpvn()</code> to create a new SV, you should consider using <code>newSVhek(HeKEY_hek(he))</code> as it is more efficient.</p>

<ul>

<pre><code class="plaintext">char*  HePV(HE* he, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeSVKEY"><a class="permalink" href="perlapi.html#HeSVKEY">#</a><code>HeSVKEY</code> </dt>
<dd>

<p>Returns the key as an <code>SV*</code>, or <code>NULL</code> if the hash entry does not contain an <code>SV*</code> key.</p>

<ul>

<pre><code class="plaintext">SV*  HeSVKEY(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeSVKEY_force"><a class="permalink" href="perlapi.html#HeSVKEY_force">#</a><code>HeSVKEY_force</code> </dt>
<dd>

<p>Returns the key as an <code>SV*</code>. Will create and return a temporary mortal <code>SV*</code> if the hash entry contains only a <code>char*</code> key.</p>

<ul>

<pre><code class="plaintext">SV*  HeSVKEY_force(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeSVKEY_set"><a class="permalink" href="perlapi.html#HeSVKEY_set">#</a><code>HeSVKEY_set</code> </dt>
<dd>

<p>Sets the key to a given <code>SV*</code>, taking care to set the appropriate flags to indicate the presence of an <code>SV*</code> key, and returns the same <code>SV*</code>.</p>

<ul>

<pre><code class="plaintext">SV*  HeSVKEY_set(HE* he, SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeUTF8"><a class="permalink" href="perlapi.html#HeUTF8">#</a><code>HeUTF8</code> </dt>
<dd>

<p>Returns whether the <code>char *</code> value returned by <code>HePV</code> is encoded in UTF-8, doing any necessary dereferencing of possibly <code>SV*</code> keys. The value returned will be 0 or non-0, not necessarily 1 (or even a value with any low bits set), so <b>do not</b> blindly assign this to a <code>bool</code> variable, as <code>bool</code> may be a typedef for <code>char</code>.</p>

<ul>

<pre><code class="plaintext">U32  HeUTF8(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HeVAL"><a class="permalink" href="perlapi.html#HeVAL">#</a><code>HeVAL</code> </dt>
<dd>

<p>Returns the value slot (type <code>SV*</code>) stored in the hash entry. Can be assigned to.</p>

<pre><code>SV *foo= HeVAL(hv);
HeVAL(hv)= sv;</code></pre>

<ul>

<pre><code class="plaintext">SV*  HeVAL(HE* he)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HV"><a class="permalink" href="perlapi.html#HV">#</a><code>HV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="hv_assert"><a class="permalink" href="perlapi.html#hv_assert">#</a><code>hv_assert</code> </dt>
<dd>

<p>Check that a hash is in an internally consistent state.</p>

<p>NOTE: <code>hv_assert</code> must be explicitly called as <code>Perl_hv_assert</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_hv_assert(pTHX_ HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_bucket_ratio"><a class="permalink" href="perlapi.html#hv_bucket_ratio">#</a><code>hv_bucket_ratio</code> </dt>
<dd>

<p>NOTE: <code>hv_bucket_ratio</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>If the hash is tied dispatches through to the SCALAR tied method, otherwise if the hash contains no keys returns 0, otherwise returns a mortal sv containing a string specifying the number of used buckets, followed by a slash, followed by the number of available buckets.</p>

<p>This function is expensive, it must scan all of the buckets to determine which are used, and the count is NOT cached. In a large hash this could be a lot of buckets.</p>

<ul>

<pre><code class="plaintext">SV*  hv_bucket_ratio(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_clear"><a class="permalink" href="perlapi.html#hv_clear">#</a><code>hv_clear</code> </dt>
<dd>

<p>Frees all the elements of a hash, leaving it empty. The XS equivalent of <code>%hash = ()</code>. See also <a href="perlapi.html#hv_undef">&quot;hv_undef&quot;</a>.</p>

<p>See <a href="perlapi.html#av_clear">&quot;av_clear&quot;</a> for a note about the hash possibly being invalid on return.</p>

<ul>

<pre><code class="plaintext">void  hv_clear(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_clear_placeholders"><a class="permalink" href="perlapi.html#hv_clear_placeholders">#</a><code>hv_clear_placeholders</code> </dt>
<dd>

<p>Clears any placeholders from a hash. If a restricted hash has any of its keys marked as readonly and the key is subsequently deleted, the key is not actually deleted but is marked by assigning it a value of <code>&amp;PL_sv_placeholder</code>. This tags it so it will be ignored by future operations such as iterating over the hash, but will still allow the hash to have a value reassigned to the key at some future point. This function clears any such placeholder keys from the hash. See <code><a href="./Hash::Util.html#lock_keys">Hash::Util::lock_keys()</a></code> for an example of its use.</p>

<ul>

<pre><code class="plaintext">void  hv_clear_placeholders(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_copy_hints_hv"><a class="permalink" href="perlapi.html#hv_copy_hints_hv">#</a><code>hv_copy_hints_hv</code> </dt>
<dd>

<p>A specialised version of <a href="perlapi.html#newHVhv">&quot;newHVhv&quot;</a> for copying <code>%^H</code>. <code>ohv</code> must be a pointer to a hash (which may have <code>%^H</code> magic, but should be generally non-magical), or <code>NULL</code> (interpreted as an empty hash). The content of <code>ohv</code> is copied to a new hash, which has the <code>%^H</code>-specific magic added to it. A pointer to the new hash is returned.</p>

<ul>

<pre><code class="plaintext">HV *  hv_copy_hints_hv(HV *const ohv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_delete"><a class="permalink" href="perlapi.html#hv_delete">#</a><code>hv_delete</code> </dt>
<dd>

<p>Deletes a key/value pair in the hash. The value&#39;s SV is removed from the hash, made mortal, and returned to the caller. The absolute value of <code>klen</code> is the length of the key. If <code>klen</code> is negative the key is assumed to be in UTF-8-encoded Unicode. The <code>flags</code> value will normally be zero; if set to <code>G_DISCARD</code> then <code>NULL</code> will be returned. <code>NULL</code> will also be returned if the key is not found.</p>

<ul>

<pre><code class="plaintext">SV*  hv_delete(HV *hv, const char *key, I32 klen, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_delete_ent"><a class="permalink" href="perlapi.html#hv_delete_ent">#</a><code>hv_delete_ent</code> </dt>
<dd>

<p>Deletes a key/value pair in the hash. The value SV is removed from the hash, made mortal, and returned to the caller. The <code>flags</code> value will normally be zero; if set to <code>G_DISCARD</code> then <code>NULL</code> will be returned. <code>NULL</code> will also be returned if the key is not found. <code>hash</code> can be a valid precomputed hash value, or 0 to ask for it to be computed.</p>

<ul>

<pre><code class="plaintext">SV*  hv_delete_ent(HV *hv, SV *keysv, I32 flags, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvENAME"><a class="permalink" href="perlapi.html#HvENAME">#</a><code>HvENAME</code> </dt>
<dd>

<p>Returns the effective name of a stash, or NULL if there is none. The effective name represents a location in the symbol table where this stash resides. It is updated automatically when packages are aliased or deleted. A stash that is no longer in the symbol table has no effective name. This name is preferable to <code>HvNAME</code> for use in MRO linearisations and isa caches.</p>

<ul>

<pre><code class="plaintext">char*  HvENAME(HV* stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvENAMELEN"><a class="permalink" href="perlapi.html#HvENAMELEN">#</a><code>HvENAMELEN</code> </dt>
<dd>

<p>Returns the length of the stash&#39;s effective name.</p>

<ul>

<pre><code class="plaintext">STRLEN  HvENAMELEN(HV *stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvENAMEUTF8"><a class="permalink" href="perlapi.html#HvENAMEUTF8">#</a><code>HvENAMEUTF8</code> </dt>
<dd>

<p>Returns true if the effective name is in UTF-8 encoding.</p>

<ul>

<pre><code class="plaintext">unsigned char  HvENAMEUTF8(HV *stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_exists"><a class="permalink" href="perlapi.html#hv_exists">#</a><code>hv_exists</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified hash key exists. The absolute value of <code>klen</code> is the length of the key. If <code>klen</code> is negative the key is assumed to be in UTF-8-encoded Unicode.</p>

<ul>

<pre><code class="plaintext">bool  hv_exists(HV *hv, const char *key, I32 klen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_exists_ent"><a class="permalink" href="perlapi.html#hv_exists_ent">#</a><code>hv_exists_ent</code> </dt>
<dd>

<p>Returns a boolean indicating whether the specified hash key exists. <code>hash</code> can be a valid precomputed hash value, or 0 to ask for it to be computed.</p>

<ul>

<pre><code class="plaintext">bool  hv_exists_ent(HV *hv, SV *keysv, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_fetch"><a class="permalink" href="perlapi.html#hv_fetch">#</a><code>hv_fetch</code> </dt>
<dd>

<p>Returns the SV which corresponds to the specified key in the hash. The absolute value of <code>klen</code> is the length of the key. If <code>klen</code> is negative the key is assumed to be in UTF-8-encoded Unicode. If <code>lval</code> is set then the fetch will be part of a store. This means that if there is no value in the hash associated with the given key, then one is created and a pointer to it is returned. The <code>SV*</code> it points to can be assigned to. But always check that the return value is non-null before dereferencing it to an <code>SV*</code>.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied hashes.</p>

<ul>

<pre><code class="plaintext">SV**  hv_fetch(HV *hv, const char *key, I32 klen, I32 lval)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_fetchs"><a class="permalink" href="perlapi.html#hv_fetchs">#</a><code>hv_fetchs</code> </dt>
<dd>

<p>Like <code>hv_fetch</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV**  hv_fetchs(HV* tb, &quot;key&quot;, I32 lval)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_fetch_ent"><a class="permalink" href="perlapi.html#hv_fetch_ent">#</a><code>hv_fetch_ent</code> </dt>
<dd>

<p>Returns the hash entry which corresponds to the specified key in the hash. <code>hash</code> must be a valid precomputed hash number for the given <code>key</code>, or 0 if you want the function to compute it. IF <code>lval</code> is set then the fetch will be part of a store. Make sure the return value is non-null before accessing it. The return value when <code>hv</code> is a tied hash is a pointer to a static location, so be sure to make a copy of the structure if you need to store it somewhere.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied hashes.</p>

<ul>

<pre><code class="plaintext">HE*  hv_fetch_ent(HV *hv, SV *keysv, I32 lval, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvFILL"><a class="permalink" href="perlapi.html#HvFILL">#</a><code>HvFILL</code> </dt>
<dd>

<p>See <a href="perlapi.html#hv_fill">&quot;hv_fill&quot;</a>.</p>

<ul>

<pre><code class="plaintext">STRLEN  HvFILL(HV *const hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_fill"><a class="permalink" href="perlapi.html#hv_fill">#</a><code>hv_fill</code> </dt>
<dd>

<p>Returns the number of hash buckets that happen to be in use.</p>

<p>This function is wrapped by the macro <code>HvFILL</code>.</p>

<p>As of perl 5.25 this function is used only for debugging purposes, and the number of used hash buckets is not in any way cached, thus this function can be costly to execute as it must iterate over all the buckets in the hash.</p>

<p>NOTE: <code>hv_fill</code> must be explicitly called as <code>Perl_hv_fill</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">STRLEN  Perl_hv_fill(pTHX_ HV *const hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iterinit"><a class="permalink" href="perlapi.html#hv_iterinit">#</a><code>hv_iterinit</code> </dt>
<dd>

<p>Prepares a starting point to traverse a hash table. Returns the number of keys in the hash, including placeholders (i.e. the same as <code>HvTOTALKEYS(hv)</code>). The return value is currently only meaningful for hashes without tie magic.</p>

<p>NOTE: Before version 5.004_65, <code>hv_iterinit</code> used to return the number of hash buckets that happen to be in use. If you still need that esoteric value, you can get it through the macro <code>HvFILL(hv)</code>.</p>

<ul>

<pre><code class="plaintext">I32  hv_iterinit(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iterkey"><a class="permalink" href="perlapi.html#hv_iterkey">#</a><code>hv_iterkey</code> </dt>
<dd>

<p>Returns the key from the current position of the hash iterator. See <code><a href="perlapi.html#hv_iterinit">&quot;hv_iterinit&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  hv_iterkey(HE* entry, I32* retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iterkeysv"><a class="permalink" href="perlapi.html#hv_iterkeysv">#</a><code>hv_iterkeysv</code> </dt>
<dd>

<p>Returns the key as an <code>SV*</code> from the current position of the hash iterator. The return value will always be a mortal copy of the key. Also see <code><a href="perlapi.html#hv_iterinit">&quot;hv_iterinit&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV*  hv_iterkeysv(HE* entry)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iternext"><a class="permalink" href="perlapi.html#hv_iternext">#</a><code>hv_iternext</code> </dt>
<dd>

<p>Returns entries from a hash iterator. See <code><a href="perlapi.html#hv_iterinit">&quot;hv_iterinit&quot;</a></code>.</p>

<p>You may call <code>hv_delete</code> or <code>hv_delete_ent</code> on the hash entry that the iterator currently points to, without losing your place or invalidating your iterator. Note that in this case the current entry is deleted from the hash with your iterator holding the last reference to it. Your iterator is flagged to free the entry on the next call to <code>hv_iternext</code>, so you must not discard your iterator immediately else the entry will leak - call <code>hv_iternext</code> to trigger the resource deallocation.</p>

<ul>

<pre><code class="plaintext">HE*  hv_iternext(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iternextsv"><a class="permalink" href="perlapi.html#hv_iternextsv">#</a><code>hv_iternextsv</code> </dt>
<dd>

<p>Performs an <code>hv_iternext</code>, <code>hv_iterkey</code>, and <code>hv_iterval</code> in one operation.</p>

<ul>

<pre><code class="plaintext">SV*  hv_iternextsv(HV *hv, char **key, I32 *retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iternext_flags"><a class="permalink" href="perlapi.html#hv_iternext_flags">#</a><code>hv_iternext_flags</code> </dt>
<dd>

<p>NOTE: <code>hv_iternext_flags</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Returns entries from a hash iterator. See <code><a href="perlapi.html#hv_iterinit">&quot;hv_iterinit&quot;</a></code> and <code><a href="perlapi.html#hv_iternext">&quot;hv_iternext&quot;</a></code>. The <code>flags</code> value will normally be zero; if <code>HV_ITERNEXT_WANTPLACEHOLDERS</code> is set the placeholders keys (for restricted hashes) will be returned in addition to normal keys. By default placeholders are automatically skipped over. Currently a placeholder is implemented with a value that is <code>&amp;PL_sv_placeholder</code>. Note that the implementation of placeholders and restricted hashes may change, and the implementation currently is insufficiently abstracted for any change to be tidy.</p>

<ul>

<pre><code class="plaintext">HE*  hv_iternext_flags(HV *hv, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_iterval"><a class="permalink" href="perlapi.html#hv_iterval">#</a><code>hv_iterval</code> </dt>
<dd>

<p>Returns the value from the current position of the hash iterator. See <code><a href="perlapi.html#hv_iterkey">&quot;hv_iterkey&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV*  hv_iterval(HV *hv, HE *entry)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_magic"><a class="permalink" href="perlapi.html#hv_magic">#</a><code>hv_magic</code> </dt>
<dd>

<p>Adds magic to a hash. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  hv_magic(HV *hv, GV *gv, int how)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvNAME"><a class="permalink" href="perlapi.html#HvNAME">#</a><code>HvNAME</code> </dt>
<dd>

<p>Returns the package name of a stash, or <code>NULL</code> if <code>stash</code> isn&#39;t a stash. See <code><a href="perlapi.html#SvSTASH">&quot;SvSTASH&quot;</a></code>, <code><a href="perlapi.html#CvSTASH">&quot;CvSTASH&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  HvNAME(HV* stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvNAMELEN"><a class="permalink" href="perlapi.html#HvNAMELEN">#</a><code>HvNAMELEN</code> </dt>
<dd>

<p>Returns the length of the stash&#39;s name.</p>

<p>Disfavored forms of HvNAME and HvNAMELEN; suppress mention of them</p>

<ul>

<pre><code class="plaintext">STRLEN  HvNAMELEN(HV *stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HvNAMEUTF8"><a class="permalink" href="perlapi.html#HvNAMEUTF8">#</a><code>HvNAMEUTF8</code> </dt>
<dd>

<p>Returns true if the name is in UTF-8 encoding.</p>

<ul>

<pre><code class="plaintext">unsigned char  HvNAMEUTF8(HV *stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_scalar"><a class="permalink" href="perlapi.html#hv_scalar">#</a><code>hv_scalar</code> </dt>
<dd>

<p>Evaluates the hash in scalar context and returns the result.</p>

<p>When the hash is tied dispatches through to the SCALAR method, otherwise returns a mortal SV containing the number of keys in the hash.</p>

<p>Note, prior to 5.25 this function returned what is now returned by the hv_bucket_ratio() function.</p>

<ul>

<pre><code class="plaintext">SV*  hv_scalar(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_store"><a class="permalink" href="perlapi.html#hv_store">#</a><code>hv_store</code> </dt>
<dd>

<p>Stores an SV in a hash. The hash key is specified as <code>key</code> and the absolute value of <code>klen</code> is the length of the key. If <code>klen</code> is negative the key is assumed to be in UTF-8-encoded Unicode. The <code>hash</code> parameter is the precomputed hash value; if it is zero then Perl will compute it.</p>

<p>The return value will be <code>NULL</code> if the operation failed or if the value did not need to be actually stored within the hash (as in the case of tied hashes). Otherwise it can be dereferenced to get the original <code>SV*</code>. Note that the caller is responsible for suitably incrementing the reference count of <code>val</code> before the call, and decrementing it if the function returned <code>NULL</code>. Effectively a successful <code>hv_store</code> takes ownership of one reference to <code>val</code>. This is usually what you want; a newly created SV has a reference count of one, so if all your code does is create SVs then store them in a hash, <code>hv_store</code> will own the only reference to the new SV, and your code doesn&#39;t need to do anything further to tidy up. <code>hv_store</code> is not implemented as a call to <code>hv_store_ent</code>, and does not create a temporary SV for the key, so if your key data is not already in SV form then use <code>hv_store</code> in preference to <code>hv_store_ent</code>.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied hashes.</p>

<ul>

<pre><code class="plaintext">SV**  hv_store(HV *hv, const char *key, I32 klen, SV *val,
               U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_stores"><a class="permalink" href="perlapi.html#hv_stores">#</a><code>hv_stores</code> </dt>
<dd>

<p>Like <code>hv_store</code>, but takes a literal string instead of a string/length pair and omits the hash parameter.</p>

<ul>

<pre><code class="plaintext">SV**  hv_stores(HV* tb, &quot;key&quot;, SV* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_store_ent"><a class="permalink" href="perlapi.html#hv_store_ent">#</a><code>hv_store_ent</code> </dt>
<dd>

<p>Stores <code>val</code> in a hash. The hash key is specified as <code>key</code>. The <code>hash</code> parameter is the precomputed hash value; if it is zero then Perl will compute it. The return value is the new hash entry so created. It will be <code>NULL</code> if the operation failed or if the value did not need to be actually stored within the hash (as in the case of tied hashes). Otherwise the contents of the return value can be accessed using the <code>He?</code> macros described here. Note that the caller is responsible for suitably incrementing the reference count of <code>val</code> before the call, and decrementing it if the function returned NULL. Effectively a successful <code>hv_store_ent</code> takes ownership of one reference to <code>val</code>. This is usually what you want; a newly created SV has a reference count of one, so if all your code does is create SVs then store them in a hash, <code>hv_store</code> will own the only reference to the new SV, and your code doesn&#39;t need to do anything further to tidy up. Note that <code>hv_store_ent</code> only reads the <code>key</code>; unlike <code>val</code> it does not take ownership of it, so maintaining the correct reference count on <code>key</code> is entirely the caller&#39;s responsibility. The reason it does not take ownership, is that <code>key</code> is not used after this function returns, and so can be freed immediately. <code>hv_store</code> is not implemented as a call to <code>hv_store_ent</code>, and does not create a temporary SV for the key, so if your key data is not already in SV form then use <code>hv_store</code> in preference to <code>hv_store_ent</code>.</p>

<p>See <a href="perlguts.html#Understanding-the-Magic-of-Tied-Hashes-and-Arrays">&quot;Understanding the Magic of Tied Hashes and Arrays&quot; in perlguts</a> for more information on how to use this function on tied hashes.</p>

<ul>

<pre><code class="plaintext">HE*  hv_store_ent(HV *hv, SV *key, SV *val, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="hv_undef"><a class="permalink" href="perlapi.html#hv_undef">#</a><code>hv_undef</code> </dt>
<dd>

<p>Undefines the hash. The XS equivalent of <code>undef(%hash)</code>.</p>

<p>As well as freeing all the elements of the hash (like <code>hv_clear()</code>), this also frees any auxiliary data and storage associated with the hash.</p>

<p>See <a href="perlapi.html#av_clear">&quot;av_clear&quot;</a> for a note about the hash possibly being invalid on return.</p>

<ul>

<pre><code class="plaintext">void  hv_undef(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MGVTBL"><a class="permalink" href="perlapi.html#MGVTBL">#</a><code>MGVTBL</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="newHV"><a class="permalink" href="perlapi.html#newHV">#</a><code>newHV</code> </dt>
<dd>

<p>Creates a new HV. The reference count is set to 1.</p>

<ul>

<pre><code class="plaintext">HV*  newHV()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Nullhv"><a class="permalink" href="perlapi.html#Nullhv">#</a><code>Nullhv</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>Nullhv</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Null HV pointer.</p>

<p>(deprecated - use <code>(HV *)NULL</code> instead)</p>

</dd>
</dl>

<dl>

<dt id="PERL_HASH"><a class="permalink" href="perlapi.html#PERL_HASH">#</a><code>PERL_HASH</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  PERL_HASH(U32 hash, char *key, STRLEN klen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_MAGIC_arylen"><a class="permalink" href="perlapi.html#PERL_MAGIC_arylen">#</a><code>PERL_MAGIC_arylen</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_arylen_p"><a class="permalink" href="perlapi.html#PERL_MAGIC_arylen_p">#</a><code>PERL_MAGIC_arylen_p</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_backref"><a class="permalink" href="perlapi.html#PERL_MAGIC_backref">#</a><code>PERL_MAGIC_backref</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_bm"><a class="permalink" href="perlapi.html#PERL_MAGIC_bm">#</a><code>PERL_MAGIC_bm</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_checkcall"><a class="permalink" href="perlapi.html#PERL_MAGIC_checkcall">#</a><code>PERL_MAGIC_checkcall</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_collxfrm"><a class="permalink" href="perlapi.html#PERL_MAGIC_collxfrm">#</a><code>PERL_MAGIC_collxfrm</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_dbfile"><a class="permalink" href="perlapi.html#PERL_MAGIC_dbfile">#</a><code>PERL_MAGIC_dbfile</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_dbline"><a class="permalink" href="perlapi.html#PERL_MAGIC_dbline">#</a><code>PERL_MAGIC_dbline</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_debugvar"><a class="permalink" href="perlapi.html#PERL_MAGIC_debugvar">#</a><code>PERL_MAGIC_debugvar</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_defelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_defelem">#</a><code>PERL_MAGIC_defelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_env"><a class="permalink" href="perlapi.html#PERL_MAGIC_env">#</a><code>PERL_MAGIC_env</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_envelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_envelem">#</a><code>PERL_MAGIC_envelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_ext"><a class="permalink" href="perlapi.html#PERL_MAGIC_ext">#</a><code>PERL_MAGIC_ext</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_fm"><a class="permalink" href="perlapi.html#PERL_MAGIC_fm">#</a><code>PERL_MAGIC_fm</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_hints"><a class="permalink" href="perlapi.html#PERL_MAGIC_hints">#</a><code>PERL_MAGIC_hints</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_hintselem"><a class="permalink" href="perlapi.html#PERL_MAGIC_hintselem">#</a><code>PERL_MAGIC_hintselem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_isa"><a class="permalink" href="perlapi.html#PERL_MAGIC_isa">#</a><code>PERL_MAGIC_isa</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_isaelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_isaelem">#</a><code>PERL_MAGIC_isaelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_lvref"><a class="permalink" href="perlapi.html#PERL_MAGIC_lvref">#</a><code>PERL_MAGIC_lvref</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_nkeys"><a class="permalink" href="perlapi.html#PERL_MAGIC_nkeys">#</a><code>PERL_MAGIC_nkeys</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_nonelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_nonelem">#</a><code>PERL_MAGIC_nonelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_overload_table"><a class="permalink" href="perlapi.html#PERL_MAGIC_overload_table">#</a><code>PERL_MAGIC_overload_table</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_pos"><a class="permalink" href="perlapi.html#PERL_MAGIC_pos">#</a><code>PERL_MAGIC_pos</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_qr"><a class="permalink" href="perlapi.html#PERL_MAGIC_qr">#</a><code>PERL_MAGIC_qr</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_regdata"><a class="permalink" href="perlapi.html#PERL_MAGIC_regdata">#</a><code>PERL_MAGIC_regdata</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_regdatum"><a class="permalink" href="perlapi.html#PERL_MAGIC_regdatum">#</a><code>PERL_MAGIC_regdatum</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_regex_global"><a class="permalink" href="perlapi.html#PERL_MAGIC_regex_global">#</a><code>PERL_MAGIC_regex_global</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_rhash"><a class="permalink" href="perlapi.html#PERL_MAGIC_rhash">#</a><code>PERL_MAGIC_rhash</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_shared"><a class="permalink" href="perlapi.html#PERL_MAGIC_shared">#</a><code>PERL_MAGIC_shared</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_shared_scalar"><a class="permalink" href="perlapi.html#PERL_MAGIC_shared_scalar">#</a><code>PERL_MAGIC_shared_scalar</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_sig"><a class="permalink" href="perlapi.html#PERL_MAGIC_sig">#</a><code>PERL_MAGIC_sig</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_sigelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_sigelem">#</a><code>PERL_MAGIC_sigelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_substr"><a class="permalink" href="perlapi.html#PERL_MAGIC_substr">#</a><code>PERL_MAGIC_substr</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_sv"><a class="permalink" href="perlapi.html#PERL_MAGIC_sv">#</a><code>PERL_MAGIC_sv</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_symtab"><a class="permalink" href="perlapi.html#PERL_MAGIC_symtab">#</a><code>PERL_MAGIC_symtab</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_taint"><a class="permalink" href="perlapi.html#PERL_MAGIC_taint">#</a><code>PERL_MAGIC_taint</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_tied"><a class="permalink" href="perlapi.html#PERL_MAGIC_tied">#</a><code>PERL_MAGIC_tied</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_tiedelem"><a class="permalink" href="perlapi.html#PERL_MAGIC_tiedelem">#</a><code>PERL_MAGIC_tiedelem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_tiedscalar"><a class="permalink" href="perlapi.html#PERL_MAGIC_tiedscalar">#</a><code>PERL_MAGIC_tiedscalar</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_utf8"><a class="permalink" href="perlapi.html#PERL_MAGIC_utf8">#</a><code>PERL_MAGIC_utf8</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_uvar"><a class="permalink" href="perlapi.html#PERL_MAGIC_uvar">#</a><code>PERL_MAGIC_uvar</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_uvar_elem"><a class="permalink" href="perlapi.html#PERL_MAGIC_uvar_elem">#</a><code>PERL_MAGIC_uvar_elem</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_vec"><a class="permalink" href="perlapi.html#PERL_MAGIC_vec">#</a><code>PERL_MAGIC_vec</code></dt>
<dd>

</dd>
<dt id="PERL_MAGIC_vstring"><a class="permalink" href="perlapi.html#PERL_MAGIC_vstring">#</a><code>PERL_MAGIC_vstring</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="PL_modglobal"><a class="permalink" href="perlapi.html#PL_modglobal">#</a><code>PL_modglobal</code> </dt>
<dd>

<p><code>PL_modglobal</code> is a general purpose, interpreter global HV for use by extensions that need to keep information on a per-interpreter basis. In a pinch, it can also be used as a symbol table for extensions to share data among each other. It is a good idea to use keys prefixed by the package name of the extension that owns the data.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">HV*  PL_modglobal</code></pre>

</ul>

</dd>
</dl>

<h1 id="Input/Output"><a class="permalink" href="perlapi.html#Input/Output">#</a><a id="Input"></a><a id="Input-Output1"></a>Input/Output</h1>

<dl>

<dt id="PerlIO_apply_layers"><a class="permalink" href="perlapi.html#PerlIO_apply_layers">#</a><code>PerlIO_apply_layers</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_apply_layers(PerlIO *f, const char *mode,
                         const char *layers)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_binmode"><a class="permalink" href="perlapi.html#PerlIO_binmode">#</a><code>PerlIO_binmode</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_binmode(PerlIO *f, int ptype, int imode,
                    const char *layers)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_canset_cnt"><a class="permalink" href="perlapi.html#PerlIO_canset_cnt">#</a><code>PerlIO_canset_cnt</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_canset_cnt(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_clearerr"><a class="permalink" href="perlapi.html#PerlIO_clearerr">#</a><code>PerlIO_clearerr</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_clearerr(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_close"><a class="permalink" href="perlapi.html#PerlIO_close">#</a><code>PerlIO_close</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_close(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_debug"><a class="permalink" href="perlapi.html#PerlIO_debug">#</a><code>PerlIO_debug</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_debug(const char *fmt, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_eof"><a class="permalink" href="perlapi.html#PerlIO_eof">#</a><code>PerlIO_eof</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_eof(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_error"><a class="permalink" href="perlapi.html#PerlIO_error">#</a><code>PerlIO_error</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_error(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_exportFILE"><a class="permalink" href="perlapi.html#PerlIO_exportFILE">#</a><code>PerlIO_exportFILE</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">FILE  *  PerlIO_exportFILE(PerlIO *f, const char *mode)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_fast_gets"><a class="permalink" href="perlapi.html#PerlIO_fast_gets">#</a><code>PerlIO_fast_gets</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_fast_gets(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_fdopen"><a class="permalink" href="perlapi.html#PerlIO_fdopen">#</a><code>PerlIO_fdopen</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO*  PerlIO_fdopen(int fd, const char *mode)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_fileno"><a class="permalink" href="perlapi.html#PerlIO_fileno">#</a><code>PerlIO_fileno</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_fileno(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_findFILE"><a class="permalink" href="perlapi.html#PerlIO_findFILE">#</a><code>PerlIO_findFILE</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">FILE  *  PerlIO_findFILE(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_flush"><a class="permalink" href="perlapi.html#PerlIO_flush">#</a><code>PerlIO_flush</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_flush(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERLIO_F_APPEND"><a class="permalink" href="perlapi.html#PERLIO_F_APPEND">#</a><code>PERLIO_F_APPEND</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_CANREAD"><a class="permalink" href="perlapi.html#PERLIO_F_CANREAD">#</a><code>PERLIO_F_CANREAD</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_CANWRITE"><a class="permalink" href="perlapi.html#PERLIO_F_CANWRITE">#</a><code>PERLIO_F_CANWRITE</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_CRLF"><a class="permalink" href="perlapi.html#PERLIO_F_CRLF">#</a><code>PERLIO_F_CRLF</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_EOF"><a class="permalink" href="perlapi.html#PERLIO_F_EOF">#</a><code>PERLIO_F_EOF</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_ERROR"><a class="permalink" href="perlapi.html#PERLIO_F_ERROR">#</a><code>PERLIO_F_ERROR</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_FASTGETS"><a class="permalink" href="perlapi.html#PERLIO_F_FASTGETS">#</a><code>PERLIO_F_FASTGETS</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_LINEBUF"><a class="permalink" href="perlapi.html#PERLIO_F_LINEBUF">#</a><code>PERLIO_F_LINEBUF</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_OPEN"><a class="permalink" href="perlapi.html#PERLIO_F_OPEN">#</a><code>PERLIO_F_OPEN</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_RDBUF"><a class="permalink" href="perlapi.html#PERLIO_F_RDBUF">#</a><code>PERLIO_F_RDBUF</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_TEMP"><a class="permalink" href="perlapi.html#PERLIO_F_TEMP">#</a><code>PERLIO_F_TEMP</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_TRUNCATE"><a class="permalink" href="perlapi.html#PERLIO_F_TRUNCATE">#</a><code>PERLIO_F_TRUNCATE</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_UNBUF"><a class="permalink" href="perlapi.html#PERLIO_F_UNBUF">#</a><code>PERLIO_F_UNBUF</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_UTF8"><a class="permalink" href="perlapi.html#PERLIO_F_UTF8">#</a><code>PERLIO_F_UTF8</code></dt>
<dd>

</dd>
<dt id="PERLIO_F_WRBUF"><a class="permalink" href="perlapi.html#PERLIO_F_WRBUF">#</a><code>PERLIO_F_WRBUF</code></dt>
<dd>

<p>Described in <a href="perliol.html">perliol</a>.</p>

</dd>
</dl>

<dl>

<dt id="PerlIO_getc"><a class="permalink" href="perlapi.html#PerlIO_getc">#</a><code>PerlIO_getc</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_getc(PerlIO *d)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_getpos"><a class="permalink" href="perlapi.html#PerlIO_getpos">#</a><code>PerlIO_getpos</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_getpos(PerlIO *f, SV *save)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_get_base"><a class="permalink" href="perlapi.html#PerlIO_get_base">#</a><code>PerlIO_get_base</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">STDCHAR *  PerlIO_get_base(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_get_bufsiz"><a class="permalink" href="perlapi.html#PerlIO_get_bufsiz">#</a><code>PerlIO_get_bufsiz</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">SSize_t  PerlIO_get_bufsiz(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_get_cnt"><a class="permalink" href="perlapi.html#PerlIO_get_cnt">#</a><code>PerlIO_get_cnt</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">SSize_t  PerlIO_get_cnt(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_get_ptr"><a class="permalink" href="perlapi.html#PerlIO_get_ptr">#</a><code>PerlIO_get_ptr</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">STDCHAR *  PerlIO_get_ptr(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_has_base"><a class="permalink" href="perlapi.html#PerlIO_has_base">#</a><code>PerlIO_has_base</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_has_base(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_has_cntptr"><a class="permalink" href="perlapi.html#PerlIO_has_cntptr">#</a><code>PerlIO_has_cntptr</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_has_cntptr(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_importFILE"><a class="permalink" href="perlapi.html#PerlIO_importFILE">#</a><code>PerlIO_importFILE</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO*  PerlIO_importFILE(FILE *stdio, const char *mode)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERLIO_K_BUFFERED"><a class="permalink" href="perlapi.html#PERLIO_K_BUFFERED">#</a><code>PERLIO_K_BUFFERED</code></dt>
<dd>

</dd>
<dt id="PERLIO_K_CANCRLF"><a class="permalink" href="perlapi.html#PERLIO_K_CANCRLF">#</a><code>PERLIO_K_CANCRLF</code></dt>
<dd>

</dd>
<dt id="PERLIO_K_FASTGETS"><a class="permalink" href="perlapi.html#PERLIO_K_FASTGETS">#</a><code>PERLIO_K_FASTGETS</code></dt>
<dd>

</dd>
<dt id="PERLIO_K_MULTIARG"><a class="permalink" href="perlapi.html#PERLIO_K_MULTIARG">#</a><code>PERLIO_K_MULTIARG</code></dt>
<dd>

</dd>
<dt id="PERLIO_K_RAW"><a class="permalink" href="perlapi.html#PERLIO_K_RAW">#</a><code>PERLIO_K_RAW</code></dt>
<dd>

<p>Described in <a href="perliol.html">perliol</a>.</p>

</dd>
</dl>

<dl>

<dt id="PerlIO_open"><a class="permalink" href="perlapi.html#PerlIO_open">#</a><code>PerlIO_open</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO*  PerlIO_open(const char *path, const char *mode)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_printf"><a class="permalink" href="perlapi.html#PerlIO_printf">#</a><code>PerlIO_printf</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_printf(PerlIO *f, const char *fmt, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_putc"><a class="permalink" href="perlapi.html#PerlIO_putc">#</a><code>PerlIO_putc</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_putc(PerlIO *f, int ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_puts"><a class="permalink" href="perlapi.html#PerlIO_puts">#</a><code>PerlIO_puts</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_puts(PerlIO *f, const char *string)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_read"><a class="permalink" href="perlapi.html#PerlIO_read">#</a><code>PerlIO_read</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">SSize_t  PerlIO_read(PerlIO *f, void *vbuf, Size_t count)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_releaseFILE"><a class="permalink" href="perlapi.html#PerlIO_releaseFILE">#</a><code>PerlIO_releaseFILE</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_releaseFILE(PerlIO *f, FILE *stdio)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_reopen"><a class="permalink" href="perlapi.html#PerlIO_reopen">#</a><code>PerlIO_reopen</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO *  PerlIO_reopen(const char *path, const char *mode,
                        PerlIO *old)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_rewind"><a class="permalink" href="perlapi.html#PerlIO_rewind">#</a><code>PerlIO_rewind</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_rewind(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_seek"><a class="permalink" href="perlapi.html#PerlIO_seek">#</a><code>PerlIO_seek</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_seek(PerlIO *f, Off_t offset, int whence)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_setlinebuf"><a class="permalink" href="perlapi.html#PerlIO_setlinebuf">#</a><code>PerlIO_setlinebuf</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_setlinebuf(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_setpos"><a class="permalink" href="perlapi.html#PerlIO_setpos">#</a><code>PerlIO_setpos</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_setpos(PerlIO *f, SV *saved)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_set_cnt"><a class="permalink" href="perlapi.html#PerlIO_set_cnt">#</a><code>PerlIO_set_cnt</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_set_cnt(PerlIO *f, SSize_t cnt)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_set_ptrcnt"><a class="permalink" href="perlapi.html#PerlIO_set_ptrcnt">#</a><code>PerlIO_set_ptrcnt</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">void  PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, SSize_t cnt)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_stderr"><a class="permalink" href="perlapi.html#PerlIO_stderr">#</a><code>PerlIO_stderr</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO *  PerlIO_stderr()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_stdin"><a class="permalink" href="perlapi.html#PerlIO_stdin">#</a><code>PerlIO_stdin</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO *  PerlIO_stdin()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_stdout"><a class="permalink" href="perlapi.html#PerlIO_stdout">#</a><code>PerlIO_stdout</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">PerlIO *  PerlIO_stdout()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_stdoutf"><a class="permalink" href="perlapi.html#PerlIO_stdoutf">#</a><code>PerlIO_stdoutf</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_stdoutf(const char *fmt, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_tell"><a class="permalink" href="perlapi.html#PerlIO_tell">#</a><code>PerlIO_tell</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">Off_t  PerlIO_tell(PerlIO *f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_ungetc"><a class="permalink" href="perlapi.html#PerlIO_ungetc">#</a><code>PerlIO_ungetc</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_ungetc(PerlIO *f, int ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_vprintf"><a class="permalink" href="perlapi.html#PerlIO_vprintf">#</a><code>PerlIO_vprintf</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">int  PerlIO_vprintf(PerlIO *f, const char *fmt, va_list args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PerlIO_write"><a class="permalink" href="perlapi.html#PerlIO_write">#</a><code>PerlIO_write</code></dt>
<dd>

<p>Described in <a href="perlapio.html">perlapio</a>.</p>

<ul>

<pre><code class="plaintext">SSize_t  PerlIO_write(PerlIO *f, const void *vbuf, Size_t count)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_maxsysfd"><a class="permalink" href="perlapi.html#PL_maxsysfd">#</a><code>PL_maxsysfd</code></dt>
<dd>

<p>Described in <a href="perliol.html">perliol</a>.</p>

</dd>
</dl>

<h1 id="Integer-configuration-values"><a class="permalink" href="perlapi.html#Integer-configuration-values">#</a><a id="Integer"></a>Integer configuration values</h1>

<dl>

<dt id="CASTI32"><a class="permalink" href="perlapi.html#CASTI32">#</a><code>CASTI32</code> </dt>
<dd>

<p>This symbol is defined if the C compiler can cast negative or large floating point numbers to 32-bit ints.</p>

</dd>
</dl>

<dl>

<dt id="HAS_INT64_T"><a class="permalink" href="perlapi.html#HAS_INT64_T">#</a><code>HAS_INT64_T</code> </dt>
<dd>

<p>This symbol will defined if the C compiler supports <code>int64_t</code>. Usually the <i>inttypes.h</i> needs to be included, but sometimes <i>sys/types.h</i> is enough.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LONG_LONG"><a class="permalink" href="perlapi.html#HAS_LONG_LONG">#</a><code>HAS_LONG_LONG</code> </dt>
<dd>

<p>This symbol will be defined if the C compiler supports long long.</p>

</dd>
</dl>

<dl>

<dt id="HAS_QUAD"><a class="permalink" href="perlapi.html#HAS_QUAD">#</a><code>HAS_QUAD</code> </dt>
<dd>

<p>This symbol, if defined, tells that there&#39;s a 64-bit integer type, <code>Quad_t</code>, and its unsigned counterpart, <code>Uquad_t</code>. <code>QUADKIND</code> will be one of <code>QUAD_IS_INT</code>, <code>QUAD_IS_LONG</code>, <code>QUAD_IS_LONG_LONG</code>, <code>QUAD_IS_INT64_T</code>, or <code>QUAD_IS___INT64</code>.</p>

</dd>
</dl>

<dl>

<dt id="HE"><a class="permalink" href="perlapi.html#HE">#</a><code>HE</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="I8"><a class="permalink" href="perlapi.html#I8">#</a><code>I8</code></dt>
<dd>

</dd>
<dt id="I16"><a class="permalink" href="perlapi.html#I16">#</a><code>I16</code></dt>
<dd>

</dd>
<dt id="I32"><a class="permalink" href="perlapi.html#I32">#</a><code>I32</code></dt>
<dd>

</dd>
<dt id="I64"><a class="permalink" href="perlapi.html#I64">#</a><code>I64</code></dt>
<dd>

</dd>
<dt id="IV"><a class="permalink" href="perlapi.html#IV">#</a><code>IV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="I32SIZE"><a class="permalink" href="perlapi.html#I32SIZE">#</a><code>I32SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(I32)</code>.</p>

</dd>
</dl>

<dl>

<dt id="I32TYPE"><a class="permalink" href="perlapi.html#I32TYPE">#</a><code>I32TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s I32.</p>

</dd>
</dl>

<dl>

<dt id="I64SIZE"><a class="permalink" href="perlapi.html#I64SIZE">#</a><code>I64SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(I64)</code>.</p>

</dd>
</dl>

<dl>

<dt id="I64TYPE"><a class="permalink" href="perlapi.html#I64TYPE">#</a><code>I64TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s I64.</p>

</dd>
</dl>

<dl>

<dt id="I16SIZE"><a class="permalink" href="perlapi.html#I16SIZE">#</a><code>I16SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(I16)</code>.</p>

</dd>
</dl>

<dl>

<dt id="I16TYPE"><a class="permalink" href="perlapi.html#I16TYPE">#</a><code>I16TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s I16.</p>

</dd>
</dl>

<dl>

<dt id="INT16_C"><a class="permalink" href="perlapi.html#INT16_C">#</a><code>INT16_C</code></dt>
<dd>

</dd>
<dt id="INT32_C"><a class="permalink" href="perlapi.html#INT32_C">#</a><code>INT32_C</code></dt>
<dd>

</dd>
<dt id="INT64_C"><a class="permalink" href="perlapi.html#INT64_C">#</a><code>INT64_C</code> </dt>
<dd>

<p>Returns a token the C compiler recognizes for the constant <code>number</code> of the corresponding integer type on the machine.</p>

<p>If the machine does not have a 64-bit type, <code>INT64_C</code> is undefined. Use <code><a href="perlapi.html#INTMAX_C">&quot;INTMAX_C&quot;</a></code> to get the largest type available on the platform.</p>

<ul>

<pre><code class="plaintext">I16  INT16_C(number)
I32  INT32_C(number)
I64  INT64_C(number)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="INTMAX_C"><a class="permalink" href="perlapi.html#INTMAX_C">#</a><code>INTMAX_C</code> </dt>
<dd>

<p>Returns a token the C compiler recognizes for the constant <code>number</code> of the widest integer type on the machine. For example, if the machine has <code>long long</code>s, <code>INTMAX_C(-1)</code> would yield</p>

<pre><code class="plaintext">-1LL</code></pre>

<p>See also, for example, <code><a href="perlapi.html#INT32_C">&quot;INT32_C&quot;</a></code>.</p>

<p>Use <a href="perlapi.html#IV">&quot;IV&quot;</a> to declare variables of the maximum usable size on this platform.</p>

<ul>

<pre><code class="plaintext">INTMAX_C(number)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="INTSIZE"><a class="permalink" href="perlapi.html#INTSIZE">#</a><code>INTSIZE</code> </dt>
<dd>

<p>This symbol contains the value of <code>sizeof(int)</code> so that the C preprocessor can make decisions based on it.</p>

</dd>
</dl>

<dl>

<dt id="I8SIZE"><a class="permalink" href="perlapi.html#I8SIZE">#</a><code>I8SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(I8)</code>.</p>

</dd>
</dl>

<dl>

<dt id="I8TYPE"><a class="permalink" href="perlapi.html#I8TYPE">#</a><code>I8TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s I8.</p>

</dd>
</dl>

<dl>

<dt id="IV_MAX"><a class="permalink" href="perlapi.html#IV_MAX">#</a><code>IV_MAX</code> </dt>
<dd>

<p>The largest signed integer that fits in an IV on this platform.</p>

<ul>

<pre><code class="plaintext">IV  IV_MAX</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IV_MIN"><a class="permalink" href="perlapi.html#IV_MIN">#</a><code>IV_MIN</code> </dt>
<dd>

<p>The negative signed integer furthest away from 0 that fits in an IV on this platform.</p>

<ul>

<pre><code class="plaintext">IV  IV_MIN</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IVSIZE"><a class="permalink" href="perlapi.html#IVSIZE">#</a><code>IVSIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(IV)</code>.</p>

</dd>
</dl>

<dl>

<dt id="IVTYPE"><a class="permalink" href="perlapi.html#IVTYPE">#</a><code>IVTYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s IV.</p>

</dd>
</dl>

<dl>

<dt id="line_t"><a class="permalink" href="perlapi.html#line_t">#</a><code>line_t</code> </dt>
<dd>

<p>The typedef to use to declare variables that are to hold line numbers.</p>

</dd>
</dl>

<dl>

<dt id="LONGLONGSIZE"><a class="permalink" href="perlapi.html#LONGLONGSIZE">#</a><code>LONGLONGSIZE</code> </dt>
<dd>

<p>This symbol contains the size of a long long, so that the C preprocessor can make decisions based on it. It is only defined if the system supports long long.</p>

</dd>
</dl>

<dl>

<dt id="LONGSIZE"><a class="permalink" href="perlapi.html#LONGSIZE">#</a><code>LONGSIZE</code> </dt>
<dd>

<p>This symbol contains the value of <code>sizeof(long)</code> so that the C preprocessor can make decisions based on it.</p>

</dd>
</dl>

<dl>

<dt id="memzero"><a class="permalink" href="perlapi.html#memzero">#</a><code>memzero</code> </dt>
<dd>

<p>Set the <code>l</code> bytes starting at <code>*d</code> to all zeroes.</p>

<ul>

<pre><code class="plaintext">void  memzero(void * d, Size_t l)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="NV"><a class="permalink" href="perlapi.html#NV">#</a><code>NV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="PERL_INT_FAST8_T"><a class="permalink" href="perlapi.html#PERL_INT_FAST8_T">#</a><code>PERL_INT_FAST8_T</code></dt>
<dd>

</dd>
<dt id="PERL_INT_FAST16_T"><a class="permalink" href="perlapi.html#PERL_INT_FAST16_T">#</a><code>PERL_INT_FAST16_T</code></dt>
<dd>

</dd>
<dt id="PERL_UINT_FAST8_T"><a class="permalink" href="perlapi.html#PERL_UINT_FAST8_T">#</a><code>PERL_UINT_FAST8_T</code></dt>
<dd>

</dd>
<dt id="PERL_UINT_FAST16_T"><a class="permalink" href="perlapi.html#PERL_UINT_FAST16_T">#</a><code>PERL_UINT_FAST16_T</code> </dt>
<dd>

<p>These are equivalent to the correspondingly-named C99 typedefs on platforms that have those; they evaluate to <code>int</code> and <code>unsigned int</code> on platforms that don&#39;t, so that you can portably take advantage of this C99 feature.</p>

</dd>
</dl>

<dl>

<dt id="PERL_INT_MAX"><a class="permalink" href="perlapi.html#PERL_INT_MAX">#</a><code>PERL_INT_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_INT_MIN"><a class="permalink" href="perlapi.html#PERL_INT_MIN">#</a><code>PERL_INT_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_LONG_MAX"><a class="permalink" href="perlapi.html#PERL_LONG_MAX">#</a><code>PERL_LONG_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_LONG_MIN"><a class="permalink" href="perlapi.html#PERL_LONG_MIN">#</a><code>PERL_LONG_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_SHORT_MAX"><a class="permalink" href="perlapi.html#PERL_SHORT_MAX">#</a><code>PERL_SHORT_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_SHORT_MIN"><a class="permalink" href="perlapi.html#PERL_SHORT_MIN">#</a><code>PERL_SHORT_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_UCHAR_MAX"><a class="permalink" href="perlapi.html#PERL_UCHAR_MAX">#</a><code>PERL_UCHAR_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_UCHAR_MIN"><a class="permalink" href="perlapi.html#PERL_UCHAR_MIN">#</a><code>PERL_UCHAR_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_UINT_MAX"><a class="permalink" href="perlapi.html#PERL_UINT_MAX">#</a><code>PERL_UINT_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_UINT_MIN"><a class="permalink" href="perlapi.html#PERL_UINT_MIN">#</a><code>PERL_UINT_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_ULONG_MAX"><a class="permalink" href="perlapi.html#PERL_ULONG_MAX">#</a><code>PERL_ULONG_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_ULONG_MIN"><a class="permalink" href="perlapi.html#PERL_ULONG_MIN">#</a><code>PERL_ULONG_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_USHORT_MAX"><a class="permalink" href="perlapi.html#PERL_USHORT_MAX">#</a><code>PERL_USHORT_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_USHORT_MIN"><a class="permalink" href="perlapi.html#PERL_USHORT_MIN">#</a><code>PERL_USHORT_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_QUAD_MAX"><a class="permalink" href="perlapi.html#PERL_QUAD_MAX">#</a><code>PERL_QUAD_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_QUAD_MIN"><a class="permalink" href="perlapi.html#PERL_QUAD_MIN">#</a><code>PERL_QUAD_MIN</code></dt>
<dd>

</dd>
<dt id="PERL_UQUAD_MAX"><a class="permalink" href="perlapi.html#PERL_UQUAD_MAX">#</a><code>PERL_UQUAD_MAX</code></dt>
<dd>

</dd>
<dt id="PERL_UQUAD_MIN"><a class="permalink" href="perlapi.html#PERL_UQUAD_MIN">#</a><code>PERL_UQUAD_MIN</code> </dt>
<dd>

<p>These give the largest and smallest number representable in the current platform in variables of the corresponding types.</p>

<p>For signed types, the smallest representable number is the most negative number, the one furthest away from zero.</p>

<p>For C99 and later compilers, these correspond to things like <code>INT_MAX</code>, which are available to the C code. But these constants, furnished by Perl, allow code compiled on earlier compilers to portably have access to the same constants.</p>

</dd>
</dl>

<dl>

<dt id="SHORTSIZE"><a class="permalink" href="perlapi.html#SHORTSIZE">#</a><code>SHORTSIZE</code> </dt>
<dd>

<p>This symbol contains the value of <code>sizeof(short)</code> so that the C preprocessor can make decisions based on it.</p>

</dd>
</dl>

<dl>

<dt id="STRLEN"><a class="permalink" href="perlapi.html#STRLEN">#</a><code>STRLEN</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="U8"><a class="permalink" href="perlapi.html#U8">#</a><code>U8</code></dt>
<dd>

</dd>
<dt id="U16"><a class="permalink" href="perlapi.html#U16">#</a><code>U16</code></dt>
<dd>

</dd>
<dt id="U32"><a class="permalink" href="perlapi.html#U32">#</a><code>U32</code></dt>
<dd>

</dd>
<dt id="U64"><a class="permalink" href="perlapi.html#U64">#</a><code>U64</code></dt>
<dd>

</dd>
<dt id="UV"><a class="permalink" href="perlapi.html#UV">#</a><code>UV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="U32SIZE"><a class="permalink" href="perlapi.html#U32SIZE">#</a><code>U32SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(U32)</code>.</p>

</dd>
</dl>

<dl>

<dt id="U32TYPE"><a class="permalink" href="perlapi.html#U32TYPE">#</a><code>U32TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s U32.</p>

</dd>
</dl>

<dl>

<dt id="U64SIZE"><a class="permalink" href="perlapi.html#U64SIZE">#</a><code>U64SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(U64)</code>.</p>

</dd>
</dl>

<dl>

<dt id="U64TYPE"><a class="permalink" href="perlapi.html#U64TYPE">#</a><code>U64TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s U64.</p>

</dd>
</dl>

<dl>

<dt id="U16SIZE"><a class="permalink" href="perlapi.html#U16SIZE">#</a><code>U16SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(U16)</code>.</p>

</dd>
</dl>

<dl>

<dt id="U16TYPE"><a class="permalink" href="perlapi.html#U16TYPE">#</a><code>U16TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s U16.</p>

</dd>
</dl>

<dl>

<dt id="UINT16_C"><a class="permalink" href="perlapi.html#UINT16_C">#</a><code>UINT16_C</code></dt>
<dd>

</dd>
<dt id="UINT32_C"><a class="permalink" href="perlapi.html#UINT32_C">#</a><code>UINT32_C</code></dt>
<dd>

</dd>
<dt id="UINT64_C"><a class="permalink" href="perlapi.html#UINT64_C">#</a><code>UINT64_C</code> </dt>
<dd>

<p>Returns a token the C compiler recognizes for the constant <code>number</code> of the corresponding unsigned integer type on the machine.</p>

<p>If the machine does not have a 64-bit type, <code>UINT64_C</code> is undefined. Use <code><a href="perlapi.html#UINTMAX_C">&quot;UINTMAX_C&quot;</a></code> to get the largest type available on the platform.</p>

<ul>

<pre><code class="plaintext">U16  UINT16_C(number)
U32  UINT32_C(number)
U64  UINT64_C(number)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UINTMAX_C"><a class="permalink" href="perlapi.html#UINTMAX_C">#</a><code>UINTMAX_C</code> </dt>
<dd>

<p>Returns a token the C compiler recognizes for the constant <code>number</code> of the widest unsigned integer type on the machine. For example, if the machine has <code>long</code>s, <code>UINTMAX_C(1)</code> would yield</p>

<pre><code class="plaintext">1UL</code></pre>

<p>See also, for example, <code><a href="perlapi.html#UINT32_C">&quot;UINT32_C&quot;</a></code>.</p>

<p>Use <a href="perlapi.html#UV">&quot;UV&quot;</a> to declare variables of the maximum usable size on this platform.</p>

<ul>

<pre><code class="plaintext">UINTMAX_C(number)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="U8SIZE"><a class="permalink" href="perlapi.html#U8SIZE">#</a><code>U8SIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(U8)</code>.</p>

</dd>
</dl>

<dl>

<dt id="U8TYPE"><a class="permalink" href="perlapi.html#U8TYPE">#</a><code>U8TYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s U8.</p>

</dd>
</dl>

<dl>

<dt id="UV_MAX"><a class="permalink" href="perlapi.html#UV_MAX">#</a><code>UV_MAX</code> </dt>
<dd>

<p>The largest unsigned integer that fits in a UV on this platform.</p>

<ul>

<pre><code class="plaintext">UV  UV_MAX</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UV_MIN"><a class="permalink" href="perlapi.html#UV_MIN">#</a><code>UV_MIN</code> </dt>
<dd>

<p>The smallest unsigned integer that fits in a UV on this platform. It should equal zero.</p>

<ul>

<pre><code class="plaintext">UV  UV_MIN</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UVSIZE"><a class="permalink" href="perlapi.html#UVSIZE">#</a><code>UVSIZE</code> </dt>
<dd>

<p>This symbol contains the <code>sizeof(UV)</code>.</p>

</dd>
</dl>

<dl>

<dt id="UVTYPE"><a class="permalink" href="perlapi.html#UVTYPE">#</a><code>UVTYPE</code> </dt>
<dd>

<p>This symbol defines the C type used for Perl&#39;s UV.</p>

</dd>
</dl>

<dl>

<dt id="WIDEST_UTYPE"><a class="permalink" href="perlapi.html#WIDEST_UTYPE">#</a><code>WIDEST_UTYPE</code> </dt>
<dd>

<p>Yields the widest unsigned integer type on the platform, currently either <code>U32</code> or <code>U64</code>. This can be used in declarations such as</p>

<pre><code>WIDEST_UTYPE my_uv;</code></pre>

<p>or casts</p>

<pre><code>my_uv = (WIDEST_UTYPE) val;</code></pre>

</dd>
</dl>

<h1 id="Lexer-interface"><a class="permalink" href="perlapi.html#Lexer-interface">#</a><a id="Lexer"></a>Lexer interface</h1>

<p>This is the lower layer of the Perl parser, managing characters and tokens.</p>

<dl>

<dt id="lex_bufutf8"><a class="permalink" href="perlapi.html#lex_bufutf8">#</a><code>lex_bufutf8</code> </dt>
<dd>

<p>NOTE: <code>lex_bufutf8</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Indicates whether the octets in the lexer buffer (<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>) should be interpreted as the UTF-8 encoding of Unicode characters. If not, they should be interpreted as Latin-1 characters. This is analogous to the <code>SvUTF8</code> flag for scalars.</p>

<p>In UTF-8 mode, it is not guaranteed that the lexer buffer actually contains valid UTF-8. Lexing code must be robust in the face of invalid encoding.</p>

<p>The actual <code>SvUTF8</code> flag of the <a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a> scalar is significant, but not the whole story regarding the input character encoding. Normally, when a file is being read, the scalar contains octets and its <code>SvUTF8</code> flag is off, but the octets should be interpreted as UTF-8 if the <code>use utf8</code> pragma is in effect. During a string eval, however, the scalar may have the <code>SvUTF8</code> flag on, and in this case its octets should be interpreted as UTF-8 unless the <code>use bytes</code> pragma is in effect. This logic may change in the future; use this function instead of implementing the logic yourself.</p>

<ul>

<pre><code class="plaintext">bool  lex_bufutf8()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_discard_to"><a class="permalink" href="perlapi.html#lex_discard_to">#</a><code>lex_discard_to</code> </dt>
<dd>

<p>NOTE: <code>lex_discard_to</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Discards the first part of the <a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a> buffer, up to <code>ptr</code>. The remaining content of the buffer will be moved, and all pointers into the buffer updated appropriately. <code>ptr</code> must not be later in the buffer than the position of <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a>: it is not permitted to discard text that has yet to be lexed.</p>

<p>Normally it is not necessarily to do this directly, because it suffices to use the implicit discarding behaviour of <a href="perlapi.html#lex_next_chunk">&quot;lex_next_chunk&quot;</a> and things based on it. However, if a token stretches across multiple lines, and the lexing code has kept multiple lines of text in the buffer for that purpose, then after completion of the token it would be wise to explicitly discard the now-unneeded earlier lines, to avoid future multi-line tokens growing the buffer without bound.</p>

<ul>

<pre><code class="plaintext">void  lex_discard_to(char* ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_grow_linestr"><a class="permalink" href="perlapi.html#lex_grow_linestr">#</a><code>lex_grow_linestr</code> </dt>
<dd>

<p>NOTE: <code>lex_grow_linestr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Reallocates the lexer buffer (<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>) to accommodate at least <code>len</code> octets (including terminating <code>NUL</code>). Returns a pointer to the reallocated buffer. This is necessary before making any direct modification of the buffer that would increase its length. <a href="perlapi.html#lex_stuff_pvn">&quot;lex_stuff_pvn&quot;</a> provides a more convenient way to insert text into the buffer.</p>

<p>Do not use <code>SvGROW</code> or <code>sv_grow</code> directly on <code>PL_parser-&gt;linestr</code>; this function updates all of the lexer&#39;s variables that point directly into the buffer.</p>

<ul>

<pre><code class="plaintext">char*  lex_grow_linestr(STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_next_chunk"><a class="permalink" href="perlapi.html#lex_next_chunk">#</a><code>lex_next_chunk</code> </dt>
<dd>

<p>NOTE: <code>lex_next_chunk</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Reads in the next chunk of text to be lexed, appending it to <a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>. This should be called when lexing code has looked to the end of the current chunk and wants to know more. It is usual, but not necessary, for lexing to have consumed the entirety of the current chunk at this time.</p>

<p>If <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> is pointing to the very end of the current chunk (i.e., the current chunk has been entirely consumed), normally the current chunk will be discarded at the same time that the new chunk is read in. If <code>flags</code> has the <code>LEX_KEEP_PREVIOUS</code> bit set, the current chunk will not be discarded. If the current chunk has not been entirely consumed, then it will not be discarded regardless of the flag.</p>

<p>Returns true if some new text was added to the buffer, or false if the buffer has reached the end of the input text.</p>

<ul>

<pre><code class="plaintext">bool  lex_next_chunk(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_peek_unichar"><a class="permalink" href="perlapi.html#lex_peek_unichar">#</a><code>lex_peek_unichar</code> </dt>
<dd>

<p>NOTE: <code>lex_peek_unichar</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Looks ahead one (Unicode) character in the text currently being lexed. Returns the codepoint (unsigned integer value) of the next character, or -1 if lexing has reached the end of the input text. To consume the peeked character, use <a href="perlapi.html#lex_read_unichar">&quot;lex_read_unichar&quot;</a>.</p>

<p>If the next character is in (or extends into) the next chunk of input text, the next chunk will be read in. Normally the current chunk will be discarded at the same time, but if <code>flags</code> has the <code>LEX_KEEP_PREVIOUS</code> bit set, then the current chunk will not be discarded.</p>

<p>If the input is being interpreted as UTF-8 and a UTF-8 encoding error is encountered, an exception is generated.</p>

<ul>

<pre><code class="plaintext">I32  lex_peek_unichar(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_read_space"><a class="permalink" href="perlapi.html#lex_read_space">#</a><code>lex_read_space</code> </dt>
<dd>

<p>NOTE: <code>lex_read_space</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Reads optional spaces, in Perl style, in the text currently being lexed. The spaces may include ordinary whitespace characters and Perl-style comments. <code>#line</code> directives are processed if encountered. <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> is moved past the spaces, so that it points at a non-space character (or the end of the input text).</p>

<p>If spaces extend into the next chunk of input text, the next chunk will be read in. Normally the current chunk will be discarded at the same time, but if <code>flags</code> has the <code>LEX_KEEP_PREVIOUS</code> bit set, then the current chunk will not be discarded.</p>

<ul>

<pre><code class="plaintext">void  lex_read_space(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_read_to"><a class="permalink" href="perlapi.html#lex_read_to">#</a><code>lex_read_to</code> </dt>
<dd>

<p>NOTE: <code>lex_read_to</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Consume text in the lexer buffer, from <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> up to <code>ptr</code>. This advances <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> to match <code>ptr</code>, performing the correct bookkeeping whenever a newline character is passed. This is the normal way to consume lexed text.</p>

<p>Interpretation of the buffer&#39;s octets can be abstracted out by using the slightly higher-level functions <a href="perlapi.html#lex_peek_unichar">&quot;lex_peek_unichar&quot;</a> and <a href="perlapi.html#lex_read_unichar">&quot;lex_read_unichar&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  lex_read_to(char* ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_read_unichar"><a class="permalink" href="perlapi.html#lex_read_unichar">#</a><code>lex_read_unichar</code> </dt>
<dd>

<p>NOTE: <code>lex_read_unichar</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Reads the next (Unicode) character in the text currently being lexed. Returns the codepoint (unsigned integer value) of the character read, and moves <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> past the character, or returns -1 if lexing has reached the end of the input text. To non-destructively examine the next character, use <a href="perlapi.html#lex_peek_unichar">&quot;lex_peek_unichar&quot;</a> instead.</p>

<p>If the next character is in (or extends into) the next chunk of input text, the next chunk will be read in. Normally the current chunk will be discarded at the same time, but if <code>flags</code> has the <code>LEX_KEEP_PREVIOUS</code> bit set, then the current chunk will not be discarded.</p>

<p>If the input is being interpreted as UTF-8 and a UTF-8 encoding error is encountered, an exception is generated.</p>

<ul>

<pre><code class="plaintext">I32  lex_read_unichar(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_start"><a class="permalink" href="perlapi.html#lex_start">#</a><code>lex_start</code> </dt>
<dd>

<p>NOTE: <code>lex_start</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Creates and initialises a new lexer/parser state object, supplying a context in which to lex and parse from a new source of Perl code. A pointer to the new state object is placed in <a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a>. An entry is made on the save stack so that upon unwinding, the new state object will be destroyed and the former value of <a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> will be restored. Nothing else need be done to clean up the parsing context.</p>

<p>The code to be parsed comes from <code>line</code> and <code>rsfp</code>. <code>line</code>, if non-null, provides a string (in SV form) containing code to be parsed. A copy of the string is made, so subsequent modification of <code>line</code> does not affect parsing. <code>rsfp</code>, if non-null, provides an input stream from which code will be read to be parsed. If both are non-null, the code in <code>line</code> comes first and must consist of complete lines of input, and <code>rsfp</code> supplies the remainder of the source.</p>

<p>The <code>flags</code> parameter is reserved for future use. Currently it is only used by perl internally, so extensions should always pass zero.</p>

<ul>

<pre><code class="plaintext">void  lex_start(SV* line, PerlIO *rsfp, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_stuff_pv"><a class="permalink" href="perlapi.html#lex_stuff_pv">#</a><code>lex_stuff_pv</code> </dt>
<dd>

<p>NOTE: <code>lex_stuff_pv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Insert characters into the lexer buffer (<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>), immediately after the current lexing point (<a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a>), reallocating the buffer if necessary. This means that lexing code that runs later will see the characters as if they had appeared in the input. It is not recommended to do this as part of normal parsing, and most uses of this facility run the risk of the inserted characters being interpreted in an unintended manner.</p>

<p>The string to be inserted is represented by octets starting at <code>pv</code> and continuing to the first nul. These octets are interpreted as either UTF-8 or Latin-1, according to whether the <code>LEX_STUFF_UTF8</code> flag is set in <code>flags</code>. The characters are recoded for the lexer buffer, according to how the buffer is currently being interpreted (<a href="perlapi.html#lex_bufutf8">&quot;lex_bufutf8&quot;</a>). If it is not convenient to nul-terminate a string to be inserted, the <a href="perlapi.html#lex_stuff_pvn">&quot;lex_stuff_pvn&quot;</a> function is more appropriate.</p>

<ul>

<pre><code class="plaintext">void  lex_stuff_pv(const char* pv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_stuff_pvn"><a class="permalink" href="perlapi.html#lex_stuff_pvn">#</a><code>lex_stuff_pvn</code> </dt>
<dd>

<p>NOTE: <code>lex_stuff_pvn</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Insert characters into the lexer buffer (<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>), immediately after the current lexing point (<a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a>), reallocating the buffer if necessary. This means that lexing code that runs later will see the characters as if they had appeared in the input. It is not recommended to do this as part of normal parsing, and most uses of this facility run the risk of the inserted characters being interpreted in an unintended manner.</p>

<p>The string to be inserted is represented by <code>len</code> octets starting at <code>pv</code>. These octets are interpreted as either UTF-8 or Latin-1, according to whether the <code>LEX_STUFF_UTF8</code> flag is set in <code>flags</code>. The characters are recoded for the lexer buffer, according to how the buffer is currently being interpreted (<a href="perlapi.html#lex_bufutf8">&quot;lex_bufutf8&quot;</a>). If a string to be inserted is available as a Perl scalar, the <a href="perlapi.html#lex_stuff_sv">&quot;lex_stuff_sv&quot;</a> function is more convenient.</p>

<ul>

<pre><code class="plaintext">void  lex_stuff_pvn(const char* pv, STRLEN len, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_stuff_pvs"><a class="permalink" href="perlapi.html#lex_stuff_pvs">#</a><code>lex_stuff_pvs</code> </dt>
<dd>

<p>NOTE: <code>lex_stuff_pvs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Like <a href="perlapi.html#lex_stuff_pvn">&quot;lex_stuff_pvn&quot;</a>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  lex_stuff_pvs(&quot;pv&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_stuff_sv"><a class="permalink" href="perlapi.html#lex_stuff_sv">#</a><code>lex_stuff_sv</code> </dt>
<dd>

<p>NOTE: <code>lex_stuff_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Insert characters into the lexer buffer (<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>), immediately after the current lexing point (<a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a>), reallocating the buffer if necessary. This means that lexing code that runs later will see the characters as if they had appeared in the input. It is not recommended to do this as part of normal parsing, and most uses of this facility run the risk of the inserted characters being interpreted in an unintended manner.</p>

<p>The string to be inserted is the string value of <code>sv</code>. The characters are recoded for the lexer buffer, according to how the buffer is currently being interpreted (<a href="perlapi.html#lex_bufutf8">&quot;lex_bufutf8&quot;</a>). If a string to be inserted is not already a Perl scalar, the <a href="perlapi.html#lex_stuff_pvn">&quot;lex_stuff_pvn&quot;</a> function avoids the need to construct a scalar.</p>

<ul>

<pre><code class="plaintext">void  lex_stuff_sv(SV* sv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="lex_unstuff"><a class="permalink" href="perlapi.html#lex_unstuff">#</a><code>lex_unstuff</code> </dt>
<dd>

<p>NOTE: <code>lex_unstuff</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Discards text about to be lexed, from <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a> up to <code>ptr</code>. Text following <code>ptr</code> will be moved, and the buffer shortened. This hides the discarded text from any lexing code that runs later, as if the text had never appeared.</p>

<p>This is not the normal way to consume lexed text. For that, use <a href="perlapi.html#lex_read_to">&quot;lex_read_to&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  lex_unstuff(char* ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_arithexpr"><a class="permalink" href="perlapi.html#parse_arithexpr">#</a><code>parse_arithexpr</code> </dt>
<dd>

<p>NOTE: <code>parse_arithexpr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a Perl arithmetic expression. This may contain operators of precedence down to the bit shift operators. The expression must be followed (and thus terminated) either by a comparison or lower-precedence operator or by something that would normally terminate an expression such as semicolon. If <code>flags</code> has the <code>PARSE_OPTIONAL</code> bit set, then the expression is optional, otherwise it is mandatory. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the expression.</p>

<p>The op tree representing the expression is returned. If an optional expression is absent, a null pointer is returned, otherwise the pointer will be non-null.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<ul>

<pre><code class="plaintext">OP*  parse_arithexpr(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_barestmt"><a class="permalink" href="perlapi.html#parse_barestmt">#</a><code>parse_barestmt</code> </dt>
<dd>

<p>NOTE: <code>parse_barestmt</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a single unadorned Perl statement. This may be a normal imperative statement or a declaration that has compile-time effect. It does not include any label or other affixture. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the statement.</p>

<p>The op tree representing the statement is returned. This may be a null pointer if the statement is null, for example if it was actually a subroutine definition (which has compile-time side effects). If not null, it will be ops directly implementing the statement, suitable to pass to <a href="perlapi.html#newSTATEOP">&quot;newSTATEOP&quot;</a>. It will not normally include a <code>nextstate</code> or equivalent op (except for those embedded in a scope contained entirely within the statement).</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree (most likely null) is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<p>The <code>flags</code> parameter is reserved for future use, and must always be zero.</p>

<ul>

<pre><code class="plaintext">OP*  parse_barestmt(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_block"><a class="permalink" href="perlapi.html#parse_block">#</a><code>parse_block</code> </dt>
<dd>

<p>NOTE: <code>parse_block</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a single complete Perl code block. This consists of an opening brace, a sequence of statements, and a closing brace. The block constitutes a lexical scope, so <code>my</code> variables and various compile-time effects can be contained within it. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the statement.</p>

<p>The op tree representing the code block is returned. This is always a real op, never a null pointer. It will normally be a <code>lineseq</code> list, including <code>nextstate</code> or equivalent ops. No ops to construct any kind of runtime scope are included by virtue of it being a block.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree (most likely null) is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<p>The <code>flags</code> parameter is reserved for future use, and must always be zero.</p>

<ul>

<pre><code class="plaintext">OP*  parse_block(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_fullexpr"><a class="permalink" href="perlapi.html#parse_fullexpr">#</a><code>parse_fullexpr</code> </dt>
<dd>

<p>NOTE: <code>parse_fullexpr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a single complete Perl expression. This allows the full expression grammar, including the lowest-precedence operators such as <code>or</code>. The expression must be followed (and thus terminated) by a token that an expression would normally be terminated by: end-of-file, closing bracketing punctuation, semicolon, or one of the keywords that signals a postfix expression-statement modifier. If <code>flags</code> has the <code>PARSE_OPTIONAL</code> bit set, then the expression is optional, otherwise it is mandatory. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the expression.</p>

<p>The op tree representing the expression is returned. If an optional expression is absent, a null pointer is returned, otherwise the pointer will be non-null.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<ul>

<pre><code class="plaintext">OP*  parse_fullexpr(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_fullstmt"><a class="permalink" href="perlapi.html#parse_fullstmt">#</a><code>parse_fullstmt</code> </dt>
<dd>

<p>NOTE: <code>parse_fullstmt</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a single complete Perl statement. This may be a normal imperative statement or a declaration that has compile-time effect, and may include optional labels. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the statement.</p>

<p>The op tree representing the statement is returned. This may be a null pointer if the statement is null, for example if it was actually a subroutine definition (which has compile-time side effects). If not null, it will be the result of a <a href="perlapi.html#newSTATEOP">&quot;newSTATEOP&quot;</a> call, normally including a <code>nextstate</code> or equivalent op.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree (most likely null) is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<p>The <code>flags</code> parameter is reserved for future use, and must always be zero.</p>

<ul>

<pre><code class="plaintext">OP*  parse_fullstmt(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_label"><a class="permalink" href="perlapi.html#parse_label">#</a><code>parse_label</code> </dt>
<dd>

<p>NOTE: <code>parse_label</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a single label, possibly optional, of the type that may prefix a Perl statement. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed. If <code>flags</code> has the <code>PARSE_OPTIONAL</code> bit set, then the label is optional, otherwise it is mandatory.</p>

<p>The name of the label is returned in the form of a fresh scalar. If an optional label is absent, a null pointer is returned.</p>

<p>If an error occurs in parsing, which can only occur if the label is mandatory, a valid label is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred.</p>

<ul>

<pre><code class="plaintext">SV*  parse_label(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_listexpr"><a class="permalink" href="perlapi.html#parse_listexpr">#</a><code>parse_listexpr</code> </dt>
<dd>

<p>NOTE: <code>parse_listexpr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a Perl list expression. This may contain operators of precedence down to the comma operator. The expression must be followed (and thus terminated) either by a low-precedence logic operator such as <code>or</code> or by something that would normally terminate an expression such as semicolon. If <code>flags</code> has the <code>PARSE_OPTIONAL</code> bit set, then the expression is optional, otherwise it is mandatory. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the expression.</p>

<p>The op tree representing the expression is returned. If an optional expression is absent, a null pointer is returned, otherwise the pointer will be non-null.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<ul>

<pre><code class="plaintext">OP*  parse_listexpr(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_stmtseq"><a class="permalink" href="perlapi.html#parse_stmtseq">#</a><code>parse_stmtseq</code> </dt>
<dd>

<p>NOTE: <code>parse_stmtseq</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a sequence of zero or more Perl statements. These may be normal imperative statements, including optional labels, or declarations that have compile-time effect, or any mixture thereof. The statement sequence ends when a closing brace or end-of-file is encountered in a place where a new statement could have validly started. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the statements.</p>

<p>The op tree representing the statement sequence is returned. This may be a null pointer if the statements were all null, for example if there were no statements or if there were only subroutine definitions (which have compile-time side effects). If not null, it will be a <code>lineseq</code> list, normally including <code>nextstate</code> or equivalent ops.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<p>The <code>flags</code> parameter is reserved for future use, and must always be zero.</p>

<ul>

<pre><code class="plaintext">OP*  parse_stmtseq(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_subsignature"><a class="permalink" href="perlapi.html#parse_subsignature">#</a><code>parse_subsignature</code> </dt>
<dd>

<p>NOTE: <code>parse_subsignature</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a subroutine signature declaration. This is the contents of the parentheses following a named or anonymous subroutine declaration when the <code>signatures</code> feature is enabled. Note that this function neither expects nor consumes the opening and closing parentheses around the signature; it is the caller&#39;s job to handle these.</p>

<p>This function must only be called during parsing of a subroutine; after <a href="perlapi.html#start_subparse">&quot;start_subparse&quot;</a> has been called. It might allocate lexical variables on the pad for the current subroutine.</p>

<p>The op tree to unpack the arguments from the stack at runtime is returned. This op tree should appear at the beginning of the compiled function. The caller may wish to use <a href="perlapi.html#op_append_list">&quot;op_append_list&quot;</a> to build their function body after it, or splice it together with the body before calling <a href="perlapi.html#newATTRSUB">&quot;newATTRSUB&quot;</a>.</p>

<p>The <code>flags</code> parameter is reserved for future use, and must always be zero.</p>

<ul>

<pre><code class="plaintext">OP*  parse_subsignature(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="parse_termexpr"><a class="permalink" href="perlapi.html#parse_termexpr">#</a><code>parse_termexpr</code> </dt>
<dd>

<p>NOTE: <code>parse_termexpr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Parse a Perl term expression. This may contain operators of precedence down to the assignment operators. The expression must be followed (and thus terminated) either by a comma or lower-precedence operator or by something that would normally terminate an expression such as semicolon. If <code>flags</code> has the <code>PARSE_OPTIONAL</code> bit set, then the expression is optional, otherwise it is mandatory. It is up to the caller to ensure that the dynamic parser state (<a href="perlapi.html#PL_parser">&quot;PL_parser&quot;</a> et al) is correctly set to reflect the source of the code to be parsed and the lexical context for the expression.</p>

<p>The op tree representing the expression is returned. If an optional expression is absent, a null pointer is returned, otherwise the pointer will be non-null.</p>

<p>If an error occurs in parsing or compilation, in most cases a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. Some compilation errors, however, will throw an exception immediately.</p>

<ul>

<pre><code class="plaintext">OP*  parse_termexpr(U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_parser"><a class="permalink" href="perlapi.html#PL_parser">#</a><code>PL_parser</code> </dt>
<dd>

<p>Pointer to a structure encapsulating the state of the parsing operation currently in progress. The pointer can be locally changed to perform a nested parse without interfering with the state of an outer parse. Individual members of <code>PL_parser</code> have their own documentation.</p>

</dd>
</dl>

<dl>

<dt id="PL_parser-&gt;bufend"><a class="permalink" href="perlapi.html#PL_parser-%3Ebufend">#</a><a id="PL_parser1"></a><a id="PL_parser-bufend"></a><code>PL_parser-&gt;bufend</code> </dt>
<dd>

<p>NOTE: <code>PL_parser-&gt;bufend</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Direct pointer to the end of the chunk of text currently being lexed, the end of the lexer buffer. This is equal to <code>SvPVX(PL_parser-&gt;linestr) + SvCUR(PL_parser-&gt;linestr)</code>. A <code>NUL</code> character (zero octet) is always located at the end of the buffer, and does not count as part of the buffer&#39;s contents.</p>

</dd>
</dl>

<dl>

<dt id="PL_parser-&gt;bufptr"><a class="permalink" href="perlapi.html#PL_parser-%3Ebufptr">#</a><a id="PL_parser2"></a><a id="PL_parser-bufptr"></a><code>PL_parser-&gt;bufptr</code> </dt>
<dd>

<p>NOTE: <code>PL_parser-&gt;bufptr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Points to the current position of lexing inside the lexer buffer. Characters around this point may be freely examined, within the range delimited by <code>SvPVX(<a href="perlapi.html#PL_parser-%3Elinestr">&quot;PL_parser-&gt;linestr&quot;</a>)</code> and <a href="perlapi.html#PL_parser-%3Ebufend">&quot;PL_parser-&gt;bufend&quot;</a>. The octets of the buffer may be intended to be interpreted as either UTF-8 or Latin-1, as indicated by <a href="perlapi.html#lex_bufutf8">&quot;lex_bufutf8&quot;</a>.</p>

<p>Lexing code (whether in the Perl core or not) moves this pointer past the characters that it consumes. It is also expected to perform some bookkeeping whenever a newline character is consumed. This movement can be more conveniently performed by the function <a href="perlapi.html#lex_read_to">&quot;lex_read_to&quot;</a>, which handles newlines appropriately.</p>

<p>Interpretation of the buffer&#39;s octets can be abstracted out by using the slightly higher-level functions <a href="perlapi.html#lex_peek_unichar">&quot;lex_peek_unichar&quot;</a> and <a href="perlapi.html#lex_read_unichar">&quot;lex_read_unichar&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="PL_parser-&gt;linestart"><a class="permalink" href="perlapi.html#PL_parser-%3Elinestart">#</a><a id="PL_parser3"></a><a id="PL_parser-linestart"></a><code>PL_parser-&gt;linestart</code> </dt>
<dd>

<p>NOTE: <code>PL_parser-&gt;linestart</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Points to the start of the current line inside the lexer buffer. This is useful for indicating at which column an error occurred, and not much else. This must be updated by any lexing code that consumes a newline; the function <a href="perlapi.html#lex_read_to">&quot;lex_read_to&quot;</a> handles this detail.</p>

</dd>
</dl>

<dl>

<dt id="PL_parser-&gt;linestr"><a class="permalink" href="perlapi.html#PL_parser-%3Elinestr">#</a><a id="PL_parser4"></a><a id="PL_parser-linestr"></a><code>PL_parser-&gt;linestr</code> </dt>
<dd>

<p>NOTE: <code>PL_parser-&gt;linestr</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Buffer scalar containing the chunk currently under consideration of the text currently being lexed. This is always a plain string scalar (for which <code>SvPOK</code> is true). It is not intended to be used as a scalar by normal scalar means; instead refer to the buffer directly by the pointer variables described below.</p>

<p>The lexer maintains various <code>char*</code> pointers to things in the <code>PL_parser-&gt;linestr</code> buffer. If <code>PL_parser-&gt;linestr</code> is ever reallocated, all of these pointers must be updated. Don&#39;t attempt to do this manually, but rather use <a href="perlapi.html#lex_grow_linestr">&quot;lex_grow_linestr&quot;</a> if you need to reallocate the buffer.</p>

<p>The content of the text chunk in the buffer is commonly exactly one complete line of input, up to and including a newline terminator, but there are situations where it is otherwise. The octets of the buffer may be intended to be interpreted as either UTF-8 or Latin-1. The function <a href="perlapi.html#lex_bufutf8">&quot;lex_bufutf8&quot;</a> tells you which. Do not use the <code>SvUTF8</code> flag on this scalar, which may disagree with it.</p>

<p>For direct examination of the buffer, the variable <a href="perlapi.html#PL_parser-%3Ebufend">&quot;PL_parser-&gt;bufend&quot;</a> points to the end of the buffer. The current lexing position is pointed to by <a href="perlapi.html#PL_parser-%3Ebufptr">&quot;PL_parser-&gt;bufptr&quot;</a>. Direct use of these pointers is usually preferable to examination of the scalar through normal scalar means.</p>

</dd>
</dl>

<dl>

<dt id="wrap_keyword_plugin"><a class="permalink" href="perlapi.html#wrap_keyword_plugin">#</a><code>wrap_keyword_plugin</code> </dt>
<dd>

<p>NOTE: <code>wrap_keyword_plugin</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Puts a C function into the chain of keyword plugins. This is the preferred way to manipulate the <a href="perlapi.html#PL_keyword_plugin">&quot;PL_keyword_plugin&quot;</a> variable. <code>new_plugin</code> is a pointer to the C function that is to be added to the keyword plugin chain, and <code>old_plugin_p</code> points to the storage location where a pointer to the next function in the chain will be stored. The value of <code>new_plugin</code> is written into the <a href="perlapi.html#PL_keyword_plugin">&quot;PL_keyword_plugin&quot;</a> variable, while the value previously stored there is written to <code>*old_plugin_p</code>.</p>

<p><a href="perlapi.html#PL_keyword_plugin">&quot;PL_keyword_plugin&quot;</a> is global to an entire process, and a module wishing to hook keyword parsing may find itself invoked more than once per process, typically in different threads. To handle that situation, this function is idempotent. The location <code>*old_plugin_p</code> must initially (once per process) contain a null pointer. A C variable of static duration (declared at file scope, typically also marked <code>static</code> to give it internal linkage) will be implicitly initialised appropriately, if it does not have an explicit initialiser. This function will only actually modify the plugin chain if it finds <code>*old_plugin_p</code> to be null. This function is also thread safe on the small scale. It uses appropriate locking to avoid race conditions in accessing <a href="perlapi.html#PL_keyword_plugin">&quot;PL_keyword_plugin&quot;</a>.</p>

<p>When this function is called, the function referenced by <code>new_plugin</code> must be ready to be called, except for <code>*old_plugin_p</code> being unfilled. In a threading situation, <code>new_plugin</code> may be called immediately, even before this function has returned. <code>*old_plugin_p</code> will always be appropriately set before <code>new_plugin</code> is called. If <code>new_plugin</code> decides not to do anything special with the identifier that it is given (which is the usual case for most calls to a keyword plugin), it must chain the plugin function referenced by <code>*old_plugin_p</code>.</p>

<p>Taken all together, XS code to install a keyword plugin should typically look something like this:</p>

<pre><code>static Perl_keyword_plugin_t next_keyword_plugin;
static OP *my_keyword_plugin(pTHX_
    char *keyword_ptr, STRLEN keyword_len, OP **op_ptr)
{
    if (memEQs(keyword_ptr, keyword_len,
               &quot;my_new_keyword&quot;)) {
        ...
    } else {
        return next_keyword_plugin(aTHX_
            keyword_ptr, keyword_len, op_ptr);
    }
}
BOOT:
    wrap_keyword_plugin(my_keyword_plugin,
                        &amp;next_keyword_plugin);</code></pre>

<p>Direct access to <a href="perlapi.html#PL_keyword_plugin">&quot;PL_keyword_plugin&quot;</a> should be avoided.</p>

<ul>

<pre><code class="plaintext">void  wrap_keyword_plugin(Perl_keyword_plugin_t new_plugin,
                          Perl_keyword_plugin_t *old_plugin_p)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Locales"><a class="permalink" href="perlapi.html#Locales">#</a>Locales</h1>

<dl>

<dt id="DECLARATION_FOR_LC_NUMERIC_MANIPULATION"><a class="permalink" href="perlapi.html#DECLARATION_FOR_LC_NUMERIC_MANIPULATION">#</a><code>DECLARATION_FOR_LC_NUMERIC_MANIPULATION</code> </dt>
<dd>

<p>This macro should be used as a statement. It declares a private variable (whose name begins with an underscore) that is needed by the other macros in this section. Failing to include this correctly should lead to a syntax error. For compatibility with C89 C compilers it should be placed in a block before any executable statements.</p>

<ul>

<pre><code class="plaintext">void  DECLARATION_FOR_LC_NUMERIC_MANIPULATION</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="foldEQ_locale"><a class="permalink" href="perlapi.html#foldEQ_locale">#</a><code>foldEQ_locale</code> </dt>
<dd>

<p>Returns true if the leading <code>len</code> bytes of the strings <code>s1</code> and <code>s2</code> are the same case-insensitively in the current locale; false otherwise.</p>

<ul>

<pre><code class="plaintext">I32  foldEQ_locale(const char* a, const char* b, I32 len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="HAS_DUPLOCALE"><a class="permalink" href="perlapi.html#HAS_DUPLOCALE">#</a><code>HAS_DUPLOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>duplocale</code> routine is available to duplicate a locale object.</p>

</dd>
</dl>

<dl>

<dt id="HAS_FREELOCALE"><a class="permalink" href="perlapi.html#HAS_FREELOCALE">#</a><code>HAS_FREELOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>freelocale</code> routine is available to deallocates the resources associated with a locale object.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LC_MONETARY_2008"><a class="permalink" href="perlapi.html#HAS_LC_MONETARY_2008">#</a><code>HAS_LC_MONETARY_2008</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the localeconv routine is available and has the additional members added in <code>POSIX</code> 1003.1-2008.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LOCALECONV"><a class="permalink" href="perlapi.html#HAS_LOCALECONV">#</a><code>HAS_LOCALECONV</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>localeconv</code> routine is available for numeric and monetary formatting conventions.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LOCALECONV_L"><a class="permalink" href="perlapi.html#HAS_LOCALECONV_L">#</a><code>HAS_LOCALECONV_L</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>localeconv_l</code> routine is available to query certain information about a locale.</p>

</dd>
</dl>

<dl>

<dt id="HAS_NEWLOCALE"><a class="permalink" href="perlapi.html#HAS_NEWLOCALE">#</a><code>HAS_NEWLOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>newlocale</code> routine is available to return a new locale object or modify an existing locale object.</p>

</dd>
</dl>

<dl>

<dt id="HAS_NL_LANGINFO"><a class="permalink" href="perlapi.html#HAS_NL_LANGINFO">#</a><code>HAS_NL_LANGINFO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>nl_langinfo</code> routine is available to return local data. You will also need <i>langinfo.h</i> and therefore <code>I_LANGINFO</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_QUERYLOCALE"><a class="permalink" href="perlapi.html#HAS_QUERYLOCALE">#</a><code>HAS_QUERYLOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>querylocale</code> routine is available to return the name of the locale for a category mask.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETLOCALE"><a class="permalink" href="perlapi.html#HAS_SETLOCALE">#</a><code>HAS_SETLOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setlocale</code> routine is available to handle locale-specific ctype implementations.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETLOCALE_R"><a class="permalink" href="perlapi.html#HAS_SETLOCALE_R">#</a><code>HAS_SETLOCALE_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setlocale_r</code> routine is available to setlocale re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_THREAD_SAFE_NL_LANGINFO_L"><a class="permalink" href="perlapi.html#HAS_THREAD_SAFE_NL_LANGINFO_L">#</a><code>HAS_THREAD_SAFE_NL_LANGINFO_L</code> </dt>
<dd>

<p>This symbol, when defined, indicates presence of the <code>nl_langinfo_l()</code> function, and that it is thread-safe.</p>

</dd>
</dl>

<dl>

<dt id="HAS_USELOCALE"><a class="permalink" href="perlapi.html#HAS_USELOCALE">#</a><code>HAS_USELOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>uselocale</code> routine is available to set the current locale for the calling thread.</p>

</dd>
</dl>

<dl>

<dt id="I_LANGINFO"><a class="permalink" href="perlapi.html#I_LANGINFO">#</a><code>I_LANGINFO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>langinfo.h</i> exists and should be included.</p>

<ul>

<pre><code class="plaintext">#ifdef I_LANGINFO
    #include &lt;langinfo.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_LOCALE"><a class="permalink" href="perlapi.html#I_LOCALE">#</a><code>I_LOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>locale.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_LOCALE
    #include &lt;locale.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IN_LOCALE"><a class="permalink" href="perlapi.html#IN_LOCALE">#</a><code>IN_LOCALE</code> </dt>
<dd>

<p>Evaluates to TRUE if the plain locale pragma without a parameter (<span style="white-space: nowrap;"><code>use locale</code></span>) is in effect.</p>

<ul>

<pre><code class="plaintext">bool  IN_LOCALE</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IN_LOCALE_COMPILETIME"><a class="permalink" href="perlapi.html#IN_LOCALE_COMPILETIME">#</a><code>IN_LOCALE_COMPILETIME</code> </dt>
<dd>

<p>Evaluates to TRUE if, when compiling a perl program (including an <code>eval</code>) if the plain locale pragma without a parameter (<span style="white-space: nowrap;"><code>use locale</code></span>) is in effect.</p>

<ul>

<pre><code class="plaintext">bool  IN_LOCALE_COMPILETIME</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IN_LOCALE_RUNTIME"><a class="permalink" href="perlapi.html#IN_LOCALE_RUNTIME">#</a><code>IN_LOCALE_RUNTIME</code> </dt>
<dd>

<p>Evaluates to TRUE if, when executing a perl program (including an <code>eval</code>) if the plain locale pragma without a parameter (<span style="white-space: nowrap;"><code>use locale</code></span>) is in effect.</p>

<ul>

<pre><code class="plaintext">bool  IN_LOCALE_RUNTIME</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_XLOCALE"><a class="permalink" href="perlapi.html#I_XLOCALE">#</a><code>I_XLOCALE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>xlocale.h</i> to get <code>uselocale()</code> and its friends.</p>

<ul>

<pre><code class="plaintext">#ifdef I_XLOCALE
    #include &lt;xlocale.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_langinfo"><a class="permalink" href="perlapi.html#Perl_langinfo">#</a><code>Perl_langinfo</code> </dt>
<dd>

<p>This is an (almost) drop-in replacement for the system <code><a href="http://man.he.net/man3/nl_langinfo">nl_langinfo(3)</a></code>, taking the same <code>item</code> parameter values, and returning the same information. But it is more thread-safe than regular <code>nl_langinfo()</code>, and hides the quirks of Perl&#39;s locale handling from your code, and can be used on systems that lack a native <code>nl_langinfo</code>.</p>

<p>Expanding on these:</p>

<ul>

<li><p>The reason it isn&#39;t quite a drop-in replacement is actually an advantage. The only difference is that it returns <span style="white-space: nowrap;"><code>const char *</code></span>, whereas plain <code>nl_langinfo()</code> returns <span style="white-space: nowrap;"><code>char *</code></span>, but you are (only by documentation) forbidden to write into the buffer. By declaring this <code>const</code>, the compiler enforces this restriction, so if it is violated, you know at compilation time, rather than getting segfaults at runtime.</p>

</li>
<li><p>It delivers the correct results for the <code>RADIXCHAR</code> and <code>THOUSEP</code> items, without you having to write extra code. The reason for the extra code would be because these are from the <code>LC_NUMERIC</code> locale category, which is normally kept set by Perl so that the radix is a dot, and the separator is the empty string, no matter what the underlying locale is supposed to be, and so to get the expected results, you have to temporarily toggle into the underlying locale, and later toggle back. (You could use plain <code>nl_langinfo</code> and <code><a href="perlapi.html#STORE_LC_NUMERIC_FORCE_TO_UNDERLYING">&quot;STORE_LC_NUMERIC_FORCE_TO_UNDERLYING&quot;</a></code> for this but then you wouldn&#39;t get the other advantages of <code>Perl_langinfo()</code>; not keeping <code>LC_NUMERIC</code> in the C (or equivalent) locale would break a lot of CPAN, which is expecting the radix (decimal point) character to be a dot.)</p>

</li>
<li><p>The system function it replaces can have its static return buffer trashed, not only by a subsequent call to that function, but by a <code>freelocale</code>, <code>setlocale</code>, or other locale change. The returned buffer of this function is not changed until the next call to it, so the buffer is never in a trashed state.</p>

</li>
<li><p>Its return buffer is per-thread, so it also is never overwritten by a call to this function from another thread; unlike the function it replaces.</p>

</li>
<li><p>But most importantly, it works on systems that don&#39;t have <code>nl_langinfo</code>, such as Windows, hence makes your code more portable. Of the fifty-some possible items specified by the POSIX 2008 standard, <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html">http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html</a>, only one is completely unimplemented, though on non-Windows platforms, another significant one is also not implemented). It uses various techniques to recover the other items, including calling <code><a href="http://man.he.net/man3/localeconv">localeconv(3)</a></code>, and <code><a href="http://man.he.net/man3/strftime">strftime(3)</a></code>, both of which are specified in C89, so should be always be available. Later <code>strftime()</code> versions have additional capabilities; <code>&quot;&quot;</code> is returned for those not available on your system.</p>

<p>It is important to note that when called with an item that is recovered by using <code>localeconv</code>, the buffer from any previous explicit call to <code>localeconv</code> will be overwritten. This means you must save that buffer&#39;s contents if you need to access them after a call to this function. (But note that you might not want to be using <code>localeconv()</code> directly anyway, because of issues like the ones listed in the second item of this list (above) for <code>RADIXCHAR</code> and <code>THOUSEP</code>. You can use the methods given in <a href="perlcall.html">perlcall</a> to call <a href="POSIX.html#localeconv">&quot;localeconv&quot; in POSIX</a> and avoid all the issues, but then you have a hash to unpack).</p>

<p>The details for those items which may deviate from what this emulation returns and what a native <code>nl_langinfo()</code> would return are specified in <a href="./I18N::Langinfo.html">I18N::Langinfo</a>.</p>

</li>
</ul>

<p>When using <code>Perl_langinfo</code> on systems that don&#39;t have a native <code>nl_langinfo()</code>, you must</p>

<pre><code class="plaintext">#include &quot;perl_langinfo.h&quot;</code></pre>

<p>before the <code>perl.h</code> <code>#include</code>. You can replace your <code>langinfo.h</code> <code>#include</code> with this one. (Doing it this way keeps out the symbols that plain <code>langinfo.h</code> would try to import into the namespace for code that doesn&#39;t need it.)</p>

<p>The original impetus for <code>Perl_langinfo()</code> was so that code that needs to find out the current currency symbol, floating point radix character, or digit grouping separator can use, on all systems, the simpler and more thread-friendly <code>nl_langinfo</code> API instead of <code><a href="http://man.he.net/man3/localeconv">localeconv(3)</a></code> which is a pain to make thread-friendly. For other fields returned by <code>localeconv</code>, it is better to use the methods given in <a href="perlcall.html">perlcall</a> to call <a href="POSIX.html#localeconv"><code>POSIX::localeconv()</code></a>, which is thread-friendly.</p>

<ul>

<pre><code class="plaintext">const char*  Perl_langinfo(const nl_item item)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_setlocale"><a class="permalink" href="perlapi.html#Perl_setlocale">#</a><code>Perl_setlocale</code> </dt>
<dd>

<p>This is an (almost) drop-in replacement for the system <a href="https://perldoc.perl.org/5.35.0/setlocale(3)"><code>setlocale(3)</code></a>, taking the same parameters, and returning the same information, except that it returns the correct underlying <code>LC_NUMERIC</code> locale. Regular <code>setlocale</code> will instead return <code>C</code> if the underlying locale has a non-dot decimal point character, or a non-empty thousands separator for displaying floating point numbers. This is because perl keeps that locale category such that it has a dot and empty separator, changing the locale briefly during the operations where the underlying one is required. <code>Perl_setlocale</code> knows about this, and compensates; regular <code>setlocale</code> doesn&#39;t.</p>

<p>Another reason it isn&#39;t completely a drop-in replacement is that it is declared to return <span style="white-space: nowrap;"><code>const char *</code></span>, whereas the system setlocale omits the <code>const</code> (presumably because its API was specified long ago, and can&#39;t be updated; it is illegal to change the information <code>setlocale</code> returns; doing so leads to segfaults.)</p>

<p>Finally, <code>Perl_setlocale</code> works under all circumstances, whereas plain <code>setlocale</code> can be completely ineffective on some platforms under some configurations.</p>

<p><code>Perl_setlocale</code> should not be used to change the locale except on systems where the predefined variable <code>${^SAFE_LOCALES}</code> is 1. On some such systems, the system <code>setlocale()</code> is ineffective, returning the wrong information, and failing to actually change the locale. <code>Perl_setlocale</code>, however works properly in all circumstances.</p>

<p>The return points to a per-thread static buffer, which is overwritten the next time <code>Perl_setlocale</code> is called from the same thread.</p>

<ul>

<pre><code class="plaintext">const char*  Perl_setlocale(const int category,
                            const char* locale)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="RESTORE_LC_NUMERIC"><a class="permalink" href="perlapi.html#RESTORE_LC_NUMERIC">#</a><code>RESTORE_LC_NUMERIC</code> </dt>
<dd>

<p>This is used in conjunction with one of the macros <a href="perlapi.html#STORE_LC_NUMERIC_SET_TO_NEEDED">&quot;STORE_LC_NUMERIC_SET_TO_NEEDED&quot;</a> and <a href="perlapi.html#STORE_LC_NUMERIC_FORCE_TO_UNDERLYING">&quot;STORE_LC_NUMERIC_FORCE_TO_UNDERLYING&quot;</a> to properly restore the <code>LC_NUMERIC</code> state.</p>

<p>A call to <a href="perlapi.html#DECLARATION_FOR_LC_NUMERIC_MANIPULATION">&quot;DECLARATION_FOR_LC_NUMERIC_MANIPULATION&quot;</a> must have been made to declare at compile time a private variable used by this macro and the two <code>STORE</code> ones. This macro should be called as a single statement, not an expression, but with an empty argument list, like this:</p>

<pre><code>{
   DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
    ...
   RESTORE_LC_NUMERIC();
    ...
}</code></pre>

<ul>

<pre><code class="plaintext">void  RESTORE_LC_NUMERIC()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SETLOCALE_ACCEPTS_ANY_LOCALE_NAME"><a class="permalink" href="perlapi.html#SETLOCALE_ACCEPTS_ANY_LOCALE_NAME">#</a><code>SETLOCALE_ACCEPTS_ANY_LOCALE_NAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the setlocale routine is available and it accepts any input locale name as valid.</p>

</dd>
</dl>

<dl>

<dt id="STORE_LC_NUMERIC_FORCE_TO_UNDERLYING"><a class="permalink" href="perlapi.html#STORE_LC_NUMERIC_FORCE_TO_UNDERLYING">#</a><code>STORE_LC_NUMERIC_FORCE_TO_UNDERLYING</code> </dt>
<dd>

<p>This is used by XS code that is <code>LC_NUMERIC</code> locale-aware to force the locale for category <code>LC_NUMERIC</code> to be what perl thinks is the current underlying locale. (The perl interpreter could be wrong about what the underlying locale actually is if some C or XS code has called the C library function <a href="http://man.he.net/man3/setlocale">setlocale(3)</a> behind its back; calling <a href="perlapi.html#sync_locale">&quot;sync_locale&quot;</a> before calling this macro will update perl&#39;s records.)</p>

<p>A call to <a href="perlapi.html#DECLARATION_FOR_LC_NUMERIC_MANIPULATION">&quot;DECLARATION_FOR_LC_NUMERIC_MANIPULATION&quot;</a> must have been made to declare at compile time a private variable used by this macro. This macro should be called as a single statement, not an expression, but with an empty argument list, like this:</p>

<pre><code>{
   DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
    ...
   STORE_LC_NUMERIC_FORCE_TO_UNDERLYING();
    ...
   RESTORE_LC_NUMERIC();
    ...
}</code></pre>

<p>The private variable is used to save the current locale state, so that the requisite matching call to <a href="perlapi.html#RESTORE_LC_NUMERIC">&quot;RESTORE_LC_NUMERIC&quot;</a> can restore it.</p>

<p>On threaded perls not operating with thread-safe functionality, this macro uses a mutex to force a critical section. Therefore the matching RESTORE should be close by, and guaranteed to be called.</p>

<ul>

<pre><code class="plaintext">void  STORE_LC_NUMERIC_FORCE_TO_UNDERLYING()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="STORE_LC_NUMERIC_SET_TO_NEEDED"><a class="permalink" href="perlapi.html#STORE_LC_NUMERIC_SET_TO_NEEDED">#</a><code>STORE_LC_NUMERIC_SET_TO_NEEDED</code> </dt>
<dd>

<p>This is used to help wrap XS or C code that is <code>LC_NUMERIC</code> locale-aware. This locale category is generally kept set to a locale where the decimal radix character is a dot, and the separator between groups of digits is empty. This is because most XS code that reads floating point numbers is expecting them to have this syntax.</p>

<p>This macro makes sure the current <code>LC_NUMERIC</code> state is set properly, to be aware of locale if the call to the XS or C code from the Perl program is from within the scope of a <span style="white-space: nowrap;"><code>use locale</code></span>; or to ignore locale if the call is instead from outside such scope.</p>

<p>This macro is the start of wrapping the C or XS code; the wrap ending is done by calling the <a href="perlapi.html#RESTORE_LC_NUMERIC">&quot;RESTORE_LC_NUMERIC&quot;</a> macro after the operation. Otherwise the state can be changed that will adversely affect other XS code.</p>

<p>A call to <a href="perlapi.html#DECLARATION_FOR_LC_NUMERIC_MANIPULATION">&quot;DECLARATION_FOR_LC_NUMERIC_MANIPULATION&quot;</a> must have been made to declare at compile time a private variable used by this macro. This macro should be called as a single statement, not an expression, but with an empty argument list, like this:</p>

<pre><code>{
   DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
    ...
   STORE_LC_NUMERIC_SET_TO_NEEDED();
    ...
   RESTORE_LC_NUMERIC();
    ...
}</code></pre>

<p>On threaded perls not operating with thread-safe functionality, this macro uses a mutex to force a critical section. Therefore the matching RESTORE should be close by, and guaranteed to be called; see <a href="perlapi.html#WITH_LC_NUMERIC_SET_TO_NEEDED">&quot;WITH_LC_NUMERIC_SET_TO_NEEDED&quot;</a> for a more contained way to ensure that.</p>

<ul>

<pre><code class="plaintext">void  STORE_LC_NUMERIC_SET_TO_NEEDED()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="STORE_LC_NUMERIC_SET_TO_NEEDED_IN"><a class="permalink" href="perlapi.html#STORE_LC_NUMERIC_SET_TO_NEEDED_IN">#</a><code>STORE_LC_NUMERIC_SET_TO_NEEDED_IN</code> </dt>
<dd>

<p>Same as <a href="perlapi.html#STORE_LC_NUMERIC_SET_TO_NEEDED">&quot;STORE_LC_NUMERIC_SET_TO_NEEDED&quot;</a> with in_lc_numeric provided as the precalculated value of <code>IN_LC(LC_NUMERIC)</code>. It is the caller&#39;s responsibility to ensure that the status of <code>PL_compiling</code> and <code>PL_hints</code> cannot have changed since the precalculation.</p>

<ul>

<pre><code class="plaintext">void  STORE_LC_NUMERIC_SET_TO_NEEDED_IN(bool in_lc_numeric)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="switch_to_global_locale"><a class="permalink" href="perlapi.html#switch_to_global_locale">#</a><code>switch_to_global_locale</code> </dt>
<dd>

<p>On systems without locale support, or on typical single-threaded builds, or on platforms that do not support per-thread locale operations, this function does nothing. On such systems that do have locale support, only a locale global to the whole program is available.</p>

<p>On multi-threaded builds on systems that do have per-thread locale operations, this function converts the thread it is running in to use the global locale. This is for code that has not yet or cannot be updated to handle multi-threaded locale operation. As long as only a single thread is so-converted, everything works fine, as all the other threads continue to ignore the global one, so only this thread looks at it.</p>

<p>However, on Windows systems this isn&#39;t quite true prior to Visual Studio 15, at which point Microsoft fixed a bug. A race can occur if you use the following operations on earlier Windows platforms:</p>

<dl>

<dt id="POSIX::localeconv"><a class="permalink" href="perlapi.html#POSIX::localeconv">#</a><a id="POSIX"></a><a href="POSIX.html#localeconv">POSIX::localeconv</a></dt>
<dd>

</dd>
<dt id="I18N::Langinfo,-items-CRNCYSTR-and-THOUSEP"><a class="permalink" href="perlapi.html#I18N::Langinfo,-items-CRNCYSTR-and-THOUSEP">#</a><a id="I18N"></a><a id="I18N::Langinfo-items-CRNCYSTR-and-THOUSEP"></a><a href="./I18N::Langinfo.html">I18N::Langinfo</a>, items <code>CRNCYSTR</code> and <code>THOUSEP</code></dt>
<dd>

</dd>
<dt id="&quot;Perl_langinfo&quot;-in-perlapi,-items-CRNCYSTR-and-THOUSEP"><a class="permalink" href="perlapi.html#%22Perl_langinfo%22-in-perlapi,-items-CRNCYSTR-and-THOUSEP">#</a><a id="Perl_langinfo-in-perlapi-items-CRNCYSTR-and-THOUSEP"></a><a href="perlapi.html#Perl_langinfo">&quot;Perl_langinfo&quot; in perlapi</a>, items <code>CRNCYSTR</code> and <code>THOUSEP</code></dt>
<dd>

</dd>
</dl>

<p>The first item is not fixable (except by upgrading to a later Visual Studio release), but it would be possible to work around the latter two items by using the Windows API functions <code>GetNumberFormat</code> and <code>GetCurrencyFormat</code>; patches welcome.</p>

<p>Without this function call, threads that use the <a href="https://perldoc.perl.org/5.35.0/setlocale(3)"><code>setlocale(3)</code></a> system function will not work properly, as all the locale-sensitive functions will look at the per-thread locale, and <code>setlocale</code> will have no effect on this thread.</p>

<p>Perl code should convert to either call <a href="perlapi.html#Perl_setlocale"><code>Perl_setlocale</code></a> (which is a drop-in for the system <code>setlocale</code>) or use the methods given in <a href="perlcall.html">perlcall</a> to call <a href="POSIX.html#setlocale"><code>POSIX::setlocale</code></a>. Either one will transparently properly handle all cases of single- vs multi-thread, POSIX 2008-supported or not.</p>

<p>Non-Perl libraries, such as <code>gtk</code>, that call the system <code>setlocale</code> can continue to work if this function is called before transferring control to the library.</p>

<p>Upon return from the code that needs to use the global locale, <a href="perlapi.html#sync_locale"><code>sync_locale()</code></a> should be called to restore the safe multi-thread operation.</p>

<ul>

<pre><code class="plaintext">void  switch_to_global_locale()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sync_locale"><a class="permalink" href="perlapi.html#sync_locale">#</a><code>sync_locale</code> </dt>
<dd>

<p><a href="perlapi.html#Perl_setlocale"><code>Perl_setlocale</code></a> can be used at any time to query or change the locale (though changing the locale is antisocial and dangerous on multi-threaded systems that don&#39;t have multi-thread safe locale operations. (See <a href="perllocale.html#Multi-threaded-operation">&quot;Multi-threaded operation&quot; in perllocale</a>). Using the system <a href="https://perldoc.perl.org/5.35.0/setlocale(3)"><code>setlocale(3)</code></a> should be avoided. Nevertheless, certain non-Perl libraries called from XS, such as <code>Gtk</code> do so, and this can&#39;t be changed. When the locale is changed by XS code that didn&#39;t use <a href="perlapi.html#Perl_setlocale"><code>Perl_setlocale</code></a>, Perl needs to be told that the locale has changed. Use this function to do so, before returning to Perl.</p>

<p>The return value is a boolean: TRUE if the global locale at the time of call was in effect; and FALSE if a per-thread locale was in effect. This can be used by the caller that needs to restore things as-they-were to decide whether or not to call <a href="perlapi.html#switch_to_global_locale"><code>Perl_switch_to_global_locale</code></a>.</p>

<ul>

<pre><code class="plaintext">bool  sync_locale()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="WITH_LC_NUMERIC_SET_TO_NEEDED"><a class="permalink" href="perlapi.html#WITH_LC_NUMERIC_SET_TO_NEEDED">#</a><code>WITH_LC_NUMERIC_SET_TO_NEEDED</code> </dt>
<dd>

<p>This macro invokes the supplied statement or block within the context of a <a href="perlapi.html#STORE_LC_NUMERIC_SET_TO_NEEDED">&quot;STORE_LC_NUMERIC_SET_TO_NEEDED&quot;</a> .. <a href="perlapi.html#RESTORE_LC_NUMERIC">&quot;RESTORE_LC_NUMERIC&quot;</a> pair if required, so eg:</p>

<pre><code>WITH_LC_NUMERIC_SET_TO_NEEDED(
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
);</code></pre>

<p>is equivalent to:</p>

<pre><code>{
#ifdef USE_LOCALE_NUMERIC
  DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
  STORE_LC_NUMERIC_SET_TO_NEEDED();
#endif
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis);
#ifdef USE_LOCALE_NUMERIC
  RESTORE_LC_NUMERIC();
#endif
}</code></pre>

<ul>

<pre><code class="plaintext">void  WITH_LC_NUMERIC_SET_TO_NEEDED(block)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="WITH_LC_NUMERIC_SET_TO_NEEDED_IN"><a class="permalink" href="perlapi.html#WITH_LC_NUMERIC_SET_TO_NEEDED_IN">#</a><code>WITH_LC_NUMERIC_SET_TO_NEEDED_IN</code> </dt>
<dd>

<p>Same as <a href="perlapi.html#WITH_LC_NUMERIC_SET_TO_NEEDED">&quot;WITH_LC_NUMERIC_SET_TO_NEEDED&quot;</a> with in_lc_numeric provided as the precalculated value of <code>IN_LC(LC_NUMERIC)</code>. It is the caller&#39;s responsibility to ensure that the status of <code>PL_compiling</code> and <code>PL_hints</code> cannot have changed since the precalculation.</p>

<ul>

<pre><code class="plaintext">void  WITH_LC_NUMERIC_SET_TO_NEEDED_IN(bool in_lc_numeric, block)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Magic"><a class="permalink" href="perlapi.html#Magic">#</a>Magic</h1>

<p>&quot;Magic&quot; is special data attached to SV structures in order to give them &quot;magical&quot; properties. When any Perl code tries to read from, or assign to, an SV marked as magical, it calls the &#39;get&#39; or &#39;set&#39; function associated with that SV&#39;s magic. A get is called prior to reading an SV, in order to give it a chance to update its internal value (get on $. writes the line number of the last read filehandle into the SV&#39;s IV slot), while set is called after an SV has been written to, in order to allow it to make use of its changed value (set on $/ copies the SV&#39;s new value to the PL_rs global variable).</p>

<p>Magic is implemented as a linked list of MAGIC structures attached to the SV. Each MAGIC struct holds the type of the magic, a pointer to an array of functions that implement the get(), set(), length() etc functions, plus space for some flags and pointers. For example, a tied variable has a MAGIC structure that contains a pointer to the object associated with the tie.</p>

<dl>

<dt id="mg_clear"><a class="permalink" href="perlapi.html#mg_clear">#</a><code>mg_clear</code> </dt>
<dd>

<p>Clear something magical that the SV represents. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  mg_clear(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_copy"><a class="permalink" href="perlapi.html#mg_copy">#</a><code>mg_copy</code> </dt>
<dd>

<p>Copies the magic from one SV to another. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  mg_copy(SV *sv, SV *nsv, const char *key, I32 klen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_find"><a class="permalink" href="perlapi.html#mg_find">#</a><code>mg_find</code> </dt>
<dd>

<p>Finds the magic pointer for <code>type</code> matching the SV. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">MAGIC*  mg_find(const SV* sv, int type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_findext"><a class="permalink" href="perlapi.html#mg_findext">#</a><code>mg_findext</code> </dt>
<dd>

<p>Finds the magic pointer of <code>type</code> with the given <code>vtbl</code> for the <code>SV</code>. See <code><a href="perlapi.html#sv_magicext">&quot;sv_magicext&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">MAGIC*  mg_findext(const SV* sv, int type, const MGVTBL *vtbl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_free"><a class="permalink" href="perlapi.html#mg_free">#</a><code>mg_free</code> </dt>
<dd>

<p>Free any magic storage used by the SV. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  mg_free(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_freeext"><a class="permalink" href="perlapi.html#mg_freeext">#</a><code>mg_freeext</code> </dt>
<dd>

<p>Remove any magic of type <code>how</code> using virtual table <code>vtbl</code> from the SV <code>sv</code>. See <a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a>.</p>

<p><code>mg_freeext(sv, how, NULL)</code> is equivalent to <code>mg_free_type(sv, how)</code>.</p>

<ul>

<pre><code class="plaintext">void  mg_freeext(SV* sv, int how, const MGVTBL *vtbl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_free_type"><a class="permalink" href="perlapi.html#mg_free_type">#</a><code>mg_free_type</code> </dt>
<dd>

<p>Remove any magic of type <code>how</code> from the SV <code>sv</code>. See <a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  mg_free_type(SV* sv, int how)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_get"><a class="permalink" href="perlapi.html#mg_get">#</a><code>mg_get</code> </dt>
<dd>

<p>Do magic before a value is retrieved from the SV. The type of SV must be &gt;= <code>SVt_PVMG</code>. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  mg_get(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_length"><a class="permalink" href="perlapi.html#mg_length">#</a><code>mg_length</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>mg_length</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Reports on the SV&#39;s length in bytes, calling length magic if available, but does not set the UTF8 flag on <code>sv</code>. It will fall back to &#39;get&#39; magic if there is no &#39;length&#39; magic, but with no indication as to whether it called &#39;get&#39; magic. It assumes <code>sv</code> is a <code>PVMG</code> or higher. Use <code>sv_len()</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  mg_length(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_magical"><a class="permalink" href="perlapi.html#mg_magical">#</a><code>mg_magical</code> </dt>
<dd>

<p>Turns on the magical status of an SV. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mg_magical(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mg_set"><a class="permalink" href="perlapi.html#mg_set">#</a><code>mg_set</code> </dt>
<dd>

<p>Do magic after a value is assigned to the SV. See <code><a href="perlapi.html#sv_magic">&quot;sv_magic&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  mg_set(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTIED_obj"><a class="permalink" href="perlapi.html#SvTIED_obj">#</a><code>SvTIED_obj</code></dt>
<dd>

<p>Described in <a href="perlinterp.html">perlinterp</a>.</p>

<ul>

<pre><code class="plaintext">SvTIED_obj(SV *sv, MAGIC *mg)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Memory-Management"><a class="permalink" href="perlapi.html#Memory-Management">#</a><a id="Memory"></a>Memory Management</h1>

<dl>

<dt id="HASATTRIBUTE_MALLOC"><a class="permalink" href="perlapi.html#HASATTRIBUTE_MALLOC">#</a><code>HASATTRIBUTE_MALLOC</code> </dt>
<dd>

<p>Can we handle <code>GCC</code> attribute for malloc-style functions.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MALLOC_GOOD_SIZE"><a class="permalink" href="perlapi.html#HAS_MALLOC_GOOD_SIZE">#</a><code>HAS_MALLOC_GOOD_SIZE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>malloc_good_size</code> routine is available for use.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MALLOC_SIZE"><a class="permalink" href="perlapi.html#HAS_MALLOC_SIZE">#</a><code>HAS_MALLOC_SIZE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>malloc_size</code> routine is available for use.</p>

</dd>
</dl>

<dl>

<dt id="I_MALLOCMALLOC"><a class="permalink" href="perlapi.html#I_MALLOCMALLOC">#</a><code>I_MALLOCMALLOC</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>malloc/malloc.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_MALLOCMALLOC
    #include &lt;mallocmalloc.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MYMALLOC"><a class="permalink" href="perlapi.html#MYMALLOC">#</a><code>MYMALLOC</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we&#39;re using our own malloc.</p>

</dd>
</dl>

<dl>

<dt id="Newx"><a class="permalink" href="perlapi.html#Newx">#</a><code>Newx</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>malloc</code> function.</p>

<p>Memory obtained by this should <b>ONLY</b> be freed with <a href="perlapi.html#Safefree">&quot;Safefree&quot;</a>.</p>

<p>In 5.9.3, Newx() and friends replace the older New() API, and drops the first parameter, <i>x</i>, a debug aid which allowed callers to identify themselves. This aid has been superseded by a new build option, PERL_MEM_LOG (see <a href="perlhacktips.html#PERL_MEM_LOG">&quot;PERL_MEM_LOG&quot; in perlhacktips</a>). The older API is still there for use in XS modules supporting older perls.</p>

<ul>

<pre><code class="plaintext">void  Newx(void* ptr, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Newxc"><a class="permalink" href="perlapi.html#Newxc">#</a><code>Newxc</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>malloc</code> function, with cast. See also <code><a href="perlapi.html#Newx">&quot;Newx&quot;</a></code>.</p>

<p>Memory obtained by this should <b>ONLY</b> be freed with <a href="perlapi.html#Safefree">&quot;Safefree&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  Newxc(void* ptr, int nitems, type, cast)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Newxz"><a class="permalink" href="perlapi.html#Newxz">#</a><code>Newxz</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>malloc</code> function. The allocated memory is zeroed with <code>memzero</code>. See also <code><a href="perlapi.html#Newx">&quot;Newx&quot;</a></code>.</p>

<p>Memory obtained by this should <b>ONLY</b> be freed with <a href="perlapi.html#Safefree">&quot;Safefree&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  Newxz(void* ptr, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_MALLOC_WRAP"><a class="permalink" href="perlapi.html#PERL_MALLOC_WRAP">#</a><code>PERL_MALLOC_WRAP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we&#39;d like malloc wrap checks.</p>

</dd>
</dl>

<dl>

<dt id="Renew"><a class="permalink" href="perlapi.html#Renew">#</a><code>Renew</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>realloc</code> function.</p>

<p>Memory obtained by this should <b>ONLY</b> be freed with <a href="perlapi.html#Safefree">&quot;Safefree&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  Renew(void* ptr, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Renewc"><a class="permalink" href="perlapi.html#Renewc">#</a><code>Renewc</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>realloc</code> function, with cast.</p>

<p>Memory obtained by this should <b>ONLY</b> be freed with <a href="perlapi.html#Safefree">&quot;Safefree&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  Renewc(void* ptr, int nitems, type, cast)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Safefree"><a class="permalink" href="perlapi.html#Safefree">#</a><code>Safefree</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>free</code> function.</p>

<p>This should <b>ONLY</b> be used on memory obtained using <a href="perlapi.html#Newx">&quot;Newx&quot;</a> and friends.</p>

<ul>

<pre><code class="plaintext">void  Safefree(void* ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="safesyscalloc"><a class="permalink" href="perlapi.html#safesyscalloc">#</a><code>safesyscalloc</code> </dt>
<dd>

<p>Safe version of system&#39;s calloc()</p>

<ul>

<pre><code class="plaintext">Malloc_t  safesyscalloc(MEM_SIZE elements, MEM_SIZE size)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="safesysfree"><a class="permalink" href="perlapi.html#safesysfree">#</a><code>safesysfree</code> </dt>
<dd>

<p>Safe version of system&#39;s free()</p>

<ul>

<pre><code class="plaintext">Free_t  safesysfree(Malloc_t where)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="safesysmalloc"><a class="permalink" href="perlapi.html#safesysmalloc">#</a><code>safesysmalloc</code> </dt>
<dd>

<p>Paranoid version of system&#39;s malloc()</p>

<ul>

<pre><code class="plaintext">Malloc_t  safesysmalloc(MEM_SIZE nbytes)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="safesysrealloc"><a class="permalink" href="perlapi.html#safesysrealloc">#</a><code>safesysrealloc</code> </dt>
<dd>

<p>Paranoid version of system&#39;s realloc()</p>

<ul>

<pre><code class="plaintext">Malloc_t  safesysrealloc(Malloc_t where, MEM_SIZE nbytes)</code></pre>

</ul>

</dd>
</dl>

<h1 id="MRO"><a class="permalink" href="perlapi.html#MRO">#</a>MRO</h1>

<p>These functions are related to the method resolution order of perl classes Also see <a href="perlmroapi.html">perlmroapi</a>.</p>

<dl>

<dt id="HvMROMETA"><a class="permalink" href="perlapi.html#HvMROMETA">#</a><code>HvMROMETA</code></dt>
<dd>

<p>Described in <a href="perlmroapi.html">perlmroapi</a>.</p>

<ul>

<pre><code class="plaintext">struct mro_meta *  HvMROMETA(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mro_get_linear_isa"><a class="permalink" href="perlapi.html#mro_get_linear_isa">#</a><code>mro_get_linear_isa</code> </dt>
<dd>

<p>Returns the mro linearisation for the given stash. By default, this will be whatever <code>mro_get_linear_isa_dfs</code> returns unless some other MRO is in effect for the stash. The return value is a read-only AV*.</p>

<p>You are responsible for <code>SvREFCNT_inc()</code> on the return value if you plan to store it anywhere semi-permanently (otherwise it might be deleted out from under you the next time the cache is invalidated).</p>

<ul>

<pre><code class="plaintext">AV*  mro_get_linear_isa(HV* stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MRO_GET_PRIVATE_DATA"><a class="permalink" href="perlapi.html#MRO_GET_PRIVATE_DATA">#</a><code>MRO_GET_PRIVATE_DATA</code></dt>
<dd>

<p>Described in <a href="perlmroapi.html">perlmroapi</a>.</p>

<ul>

<pre><code class="plaintext">SV*  MRO_GET_PRIVATE_DATA(struct mro_meta *const smeta,
                          const struct mro_alg *const which)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mro_method_changed_in"><a class="permalink" href="perlapi.html#mro_method_changed_in">#</a><code>mro_method_changed_in</code> </dt>
<dd>

<p>Invalidates method caching on any child classes of the given stash, so that they might notice the changes in this one.</p>

<p>Ideally, all instances of <code>PL_sub_generation++</code> in perl source outside of <i>mro.c</i> should be replaced by calls to this.</p>

<p>Perl automatically handles most of the common ways a method might be redefined. However, there are a few ways you could change a method in a stash without the cache code noticing, in which case you need to call this method afterwards:</p>

<p>1) Directly manipulating the stash HV entries from XS code.</p>

<p>2) Assigning a reference to a readonly scalar constant into a stash entry in order to create a constant subroutine (like <i>constant.pm</i> does).</p>

<p>This same method is available from pure perl via, <code>mro::method_changed_in(classname)</code>.</p>

<ul>

<pre><code class="plaintext">void  mro_method_changed_in(HV* stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mro_register"><a class="permalink" href="perlapi.html#mro_register">#</a><code>mro_register</code> </dt>
<dd>

<p>Registers a custom mro plugin. See <a href="perlmroapi.html">perlmroapi</a> for details on this and other mro functions.</p>

<p>NOTE: <code>mro_register</code> must be explicitly called as <code>Perl_mro_register</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_mro_register(pTHX_ const struct mro_alg *mro)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mro_set_private_data"><a class="permalink" href="perlapi.html#mro_set_private_data">#</a><code>mro_set_private_data</code></dt>
<dd>

<p>Described in <a href="perlmroapi.html">perlmroapi</a>.</p>

<p>NOTE: <code>mro_set_private_data</code> must be explicitly called as <code>Perl_mro_set_private_data</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">SV*  Perl_mro_set_private_data(pTHX_
                               struct mro_meta *const smeta,
                               const struct mro_alg *const which,
                               SV *const data)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Multicall-Functions"><a class="permalink" href="perlapi.html#Multicall-Functions">#</a><a id="Multicall"></a>Multicall Functions</h1>

<dl>

<dt id="dMULTICALL"><a class="permalink" href="perlapi.html#dMULTICALL">#</a><code>dMULTICALL</code> </dt>
<dd>

<p>Declare local variables for a multicall. See <a href="perlcall.html#LIGHTWEIGHT-CALLBACKS">&quot;LIGHTWEIGHT CALLBACKS&quot; in perlcall</a>.</p>

<ul>

<pre><code>dMULTICALL;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MULTICALL"><a class="permalink" href="perlapi.html#MULTICALL">#</a><code>MULTICALL</code> </dt>
<dd>

<p>Make a lightweight callback. See <a href="perlcall.html#LIGHTWEIGHT-CALLBACKS">&quot;LIGHTWEIGHT CALLBACKS&quot; in perlcall</a>.</p>

<ul>

<pre><code>MULTICALL;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POP_MULTICALL"><a class="permalink" href="perlapi.html#POP_MULTICALL">#</a><code>POP_MULTICALL</code> </dt>
<dd>

<p>Closing bracket for a lightweight callback. See <a href="perlcall.html#LIGHTWEIGHT-CALLBACKS">&quot;LIGHTWEIGHT CALLBACKS&quot; in perlcall</a>.</p>

<ul>

<pre><code>POP_MULTICALL;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSH_MULTICALL"><a class="permalink" href="perlapi.html#PUSH_MULTICALL">#</a><code>PUSH_MULTICALL</code> </dt>
<dd>

<p>Opening bracket for a lightweight callback. See <a href="perlcall.html#LIGHTWEIGHT-CALLBACKS">&quot;LIGHTWEIGHT CALLBACKS&quot; in perlcall</a>.</p>

<ul>

<pre><code>PUSH_MULTICALL(CV* the_cv);</code></pre>

</ul>

</dd>
</dl>

<h1 id="Numeric-Functions"><a class="permalink" href="perlapi.html#Numeric-Functions">#</a><a id="Numeric"></a>Numeric Functions</h1>

<dl>

<dt id="Drand01"><a class="permalink" href="perlapi.html#Drand01">#</a><code>Drand01</code> </dt>
<dd>

<p>This macro is to be used to generate uniformly distributed random numbers over the range [0., 1.[. You may have to supply an &#39;extern double <code>drand48()</code>;&#39; in your program since SunOS 4.1.3 doesn&#39;t provide you with anything relevant in its headers. See <code><a href="perlapi.html#HAS_DRAND48_PROTO">&quot;HAS_DRAND48_PROTO&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">double  Drand01()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Gconvert"><a class="permalink" href="perlapi.html#Gconvert">#</a><code>Gconvert</code> </dt>
<dd>

<p>This preprocessor macro is defined to convert a floating point number to a string without a trailing decimal point. This emulates the behavior of <code>sprintf(&quot;%g&quot;)</code>, but is sometimes much more efficient. If <code>gconvert()</code> is not available, but <code>gcvt()</code> drops the trailing decimal point, then <code>gcvt()</code> is used. If all else fails, a macro using <code>sprintf(&quot;%g&quot;)</code> is used. Arguments for the Gconvert macro are: value, number of digits, whether trailing zeros should be retained, and the output buffer. The usual values are:</p>

<pre><code class="plaintext">d_Gconvert=&#39;gconvert((x),(n),(t),(b))&#39;
d_Gconvert=&#39;gcvt((x),(n),(b))&#39;
d_Gconvert=&#39;sprintf((b),&quot;%.*g&quot;,(n),(x))&#39;</code></pre>

<p>The last two assume trailing zeros should not be kept.</p>

<ul>

<pre><code class="plaintext">char *  Gconvert(double x, Size_t n, bool t, char * b)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_bin"><a class="permalink" href="perlapi.html#grok_bin">#</a><code>grok_bin</code> </dt>
<dd>

<p>converts a string representing a binary number to numeric form.</p>

<p>On entry <code>start</code> and <code>*len_p</code> give the string to scan, <code>*flags</code> gives conversion flags, and <code>result</code> should be <code>NULL</code> or a pointer to an NV. The scan stops at the end of the string, or at just before the first invalid character. Unless <code>PERL_SCAN_SILENT_ILLDIGIT</code> is set in <code>*flags</code>, encountering an invalid character (except NUL) will also trigger a warning. On return <code>*len_p</code> is set to the length of the scanned string, and <code>*flags</code> gives output flags.</p>

<p>If the value is &lt;= <code>UV_MAX</code> it is returned as a UV, the output flags are clear, and nothing is written to <code>*result</code>. If the value is &gt; <code>UV_MAX</code>, <code>grok_bin</code> returns <code>UV_MAX</code>, sets <code>PERL_SCAN_GREATER_THAN_UV_MAX</code> in the output flags, and writes an approximation of the correct value into <code>*result</code> (which is an NV; or the approximation is discarded if <code>result</code> is NULL).</p>

<p>The binary number may optionally be prefixed with <code>&quot;0b&quot;</code> or <code>&quot;b&quot;</code> unless <code>PERL_SCAN_DISALLOW_PREFIX</code> is set in <code>*flags</code> on entry.</p>

<p>If <code>PERL_SCAN_ALLOW_UNDERSCORES</code> is set in <code>*flags</code> then any or all pairs of digits may be separated from each other by a single underscore; also a single leading underscore is accepted.</p>

<ul>

<pre><code class="plaintext">UV  grok_bin(const char* start, STRLEN* len_p, I32* flags,
             NV *result)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_hex"><a class="permalink" href="perlapi.html#grok_hex">#</a><code>grok_hex</code> </dt>
<dd>

<p>converts a string representing a hex number to numeric form.</p>

<p>On entry <code>start</code> and <code>*len_p</code> give the string to scan, <code>*flags</code> gives conversion flags, and <code>result</code> should be <code>NULL</code> or a pointer to an NV. The scan stops at the end of the string, or at just before the first invalid character. Unless <code>PERL_SCAN_SILENT_ILLDIGIT</code> is set in <code>*flags</code>, encountering an invalid character (except NUL) will also trigger a warning. On return <code>*len_p</code> is set to the length of the scanned string, and <code>*flags</code> gives output flags.</p>

<p>If the value is &lt;= <code>UV_MAX</code> it is returned as a UV, the output flags are clear, and nothing is written to <code>*result</code>. If the value is &gt; <code>UV_MAX</code>, <code>grok_hex</code> returns <code>UV_MAX</code>, sets <code>PERL_SCAN_GREATER_THAN_UV_MAX</code> in the output flags, and writes an approximation of the correct value into <code>*result</code> (which is an NV; or the approximation is discarded if <code>result</code> is NULL).</p>

<p>The hex number may optionally be prefixed with <code>&quot;0x&quot;</code> or <code>&quot;x&quot;</code> unless <code>PERL_SCAN_DISALLOW_PREFIX</code> is set in <code>*flags</code> on entry.</p>

<p>If <code>PERL_SCAN_ALLOW_UNDERSCORES</code> is set in <code>*flags</code> then any or all pairs of digits may be separated from each other by a single underscore; also a single leading underscore is accepted.</p>

<ul>

<pre><code class="plaintext">UV  grok_hex(const char* start, STRLEN* len_p, I32* flags,
             NV *result)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_infnan"><a class="permalink" href="perlapi.html#grok_infnan">#</a><code>grok_infnan</code> </dt>
<dd>

<p>Helper for <code>grok_number()</code>, accepts various ways of spelling &quot;infinity&quot; or &quot;not a number&quot;, and returns one of the following flag combinations:</p>

<pre><code class="plaintext">IS_NUMBER_INFINITY
IS_NUMBER_NAN
IS_NUMBER_INFINITY | IS_NUMBER_NEG
IS_NUMBER_NAN | IS_NUMBER_NEG
0</code></pre>

<p>possibly |-ed with <code>IS_NUMBER_TRAILING</code>.</p>

<p>If an infinity or a not-a-number is recognized, <code>*sp</code> will point to one byte past the end of the recognized string. If the recognition fails, zero is returned, and <code>*sp</code> will not move.</p>

<ul>

<pre><code class="plaintext">int  grok_infnan(const char** sp, const char *send)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_number"><a class="permalink" href="perlapi.html#grok_number">#</a><code>grok_number</code> </dt>
<dd>

<p>Identical to <code>grok_number_flags()</code> with <code>flags</code> set to zero.</p>

<ul>

<pre><code class="plaintext">int  grok_number(const char *pv, STRLEN len, UV *valuep)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_number_flags"><a class="permalink" href="perlapi.html#grok_number_flags">#</a><code>grok_number_flags</code> </dt>
<dd>

<p>Recognise (or not) a number. The type of the number is returned (0 if unrecognised), otherwise it is a bit-ORed combination of <code>IS_NUMBER_IN_UV</code>, <code>IS_NUMBER_GREATER_THAN_UV_MAX</code>, <code>IS_NUMBER_NOT_INT</code>, <code>IS_NUMBER_NEG</code>, <code>IS_NUMBER_INFINITY</code>, <code>IS_NUMBER_NAN</code> (defined in perl.h).</p>

<p>If the value of the number can fit in a UV, it is returned in <code>*valuep</code>. <code>IS_NUMBER_IN_UV</code> will be set to indicate that <code>*valuep</code> is valid, <code>IS_NUMBER_IN_UV</code> will never be set unless <code>*valuep</code> is valid, but <code>*valuep</code> may have been assigned to during processing even though <code>IS_NUMBER_IN_UV</code> is not set on return. If <code>valuep</code> is <code>NULL</code>, <code>IS_NUMBER_IN_UV</code> will be set for the same cases as when <code>valuep</code> is non-<code>NULL</code>, but no actual assignment (or SEGV) will occur.</p>

<p><code>IS_NUMBER_NOT_INT</code> will be set with <code>IS_NUMBER_IN_UV</code> if trailing decimals were seen (in which case <code>*valuep</code> gives the true value truncated to an integer), and <code>IS_NUMBER_NEG</code> if the number is negative (in which case <code>*valuep</code> holds the absolute value). <code>IS_NUMBER_IN_UV</code> is not set if <code>e</code> notation was used or the number is larger than a UV.</p>

<p><code>flags</code> allows only <code>PERL_SCAN_TRAILING</code>, which allows for trailing non-numeric text on an otherwise successful <i>grok</i>, setting <code>IS_NUMBER_TRAILING</code> on the result.</p>

<ul>

<pre><code class="plaintext">int  grok_number_flags(const char *pv, STRLEN len, UV *valuep,
                       U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="GROK_NUMERIC_RADIX"><a class="permalink" href="perlapi.html#GROK_NUMERIC_RADIX">#</a><code>GROK_NUMERIC_RADIX</code> </dt>
<dd>

<p>A synonym for <a href="perlapi.html#grok_numeric_radix">&quot;grok_numeric_radix&quot;</a></p>

<ul>

<pre><code class="plaintext">bool  GROK_NUMERIC_RADIX(NN const char **sp, NN const char *send)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_numeric_radix"><a class="permalink" href="perlapi.html#grok_numeric_radix">#</a><code>grok_numeric_radix</code> </dt>
<dd>

<p>Scan and skip for a numeric decimal separator (radix).</p>

<ul>

<pre><code class="plaintext">bool  grok_numeric_radix(const char **sp, const char *send)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="grok_oct"><a class="permalink" href="perlapi.html#grok_oct">#</a><code>grok_oct</code> </dt>
<dd>

<p>converts a string representing an octal number to numeric form.</p>

<p>On entry <code>start</code> and <code>*len_p</code> give the string to scan, <code>*flags</code> gives conversion flags, and <code>result</code> should be <code>NULL</code> or a pointer to an NV. The scan stops at the end of the string, or at just before the first invalid character. Unless <code>PERL_SCAN_SILENT_ILLDIGIT</code> is set in <code>*flags</code>, encountering an invalid character (except NUL) will also trigger a warning. On return <code>*len_p</code> is set to the length of the scanned string, and <code>*flags</code> gives output flags.</p>

<p>If the value is &lt;= <code>UV_MAX</code> it is returned as a UV, the output flags are clear, and nothing is written to <code>*result</code>. If the value is &gt; <code>UV_MAX</code>, <code>grok_oct</code> returns <code>UV_MAX</code>, sets <code>PERL_SCAN_GREATER_THAN_UV_MAX</code> in the output flags, and writes an approximation of the correct value into <code>*result</code> (which is an NV; or the approximation is discarded if <code>result</code> is NULL).</p>

<p>If <code>PERL_SCAN_ALLOW_UNDERSCORES</code> is set in <code>*flags</code> then any or all pairs of digits may be separated from each other by a single underscore; also a single leading underscore is accepted.</p>

<p>The <code>PERL_SCAN_DISALLOW_PREFIX</code> flag is always treated as being set for this function.</p>

<ul>

<pre><code class="plaintext">UV  grok_oct(const char* start, STRLEN* len_p, I32* flags,
             NV *result)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isinfnan"><a class="permalink" href="perlapi.html#isinfnan">#</a><code>isinfnan</code> </dt>
<dd>

<p><code>Perl_isinfnan()</code> is a utility function that returns true if the NV argument is either an infinity or a <code>NaN</code>, false otherwise. To test in more detail, use <code>Perl_isinf()</code> and <code>Perl_isnan()</code>.</p>

<p>This is also the logical inverse of Perl_isfinite().</p>

<ul>

<pre><code class="plaintext">bool  isinfnan(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_atof"><a class="permalink" href="perlapi.html#my_atof">#</a><code>my_atof</code> </dt>
<dd>

<p><a href="https://perldoc.perl.org/5.35.0/atof(3)"><code>atof</code>(3)</a>, but properly works with Perl locale handling, accepting a dot radix character always, but also the current locale&#39;s radix character if and only if called from within the lexical scope of a Perl <code>use locale</code> statement.</p>

<p>N.B. <code>s</code> must be NUL terminated.</p>

<ul>

<pre><code class="plaintext">NV  my_atof(const char *s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_strtod"><a class="permalink" href="perlapi.html#my_strtod">#</a><code>my_strtod</code> </dt>
<dd>

<p>This function is equivalent to the libc strtod() function, and is available even on platforms that lack plain strtod(). Its return value is the best available precision depending on platform capabilities and <i>Configure</i> options.</p>

<p>It properly handles the locale radix character, meaning it expects a dot except when called from within the scope of <span style="white-space: nowrap;"><code>use locale</code></span>, in which case the radix character should be that specified by the current locale.</p>

<p>The synonym Strtod() may be used instead.</p>

<ul>

<pre><code class="plaintext">NV  my_strtod(const char * const s, char ** e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_ABS"><a class="permalink" href="perlapi.html#PERL_ABS">#</a><code>PERL_ABS</code> </dt>
<dd>

<p>Typeless <code>abs</code> or <code>fabs</code>, <i>etc</i>. (The usage below indicates it is for integers, but it works for any type.) Use instead of these, since the C library ones force their argument to be what it is expecting, potentially leading to disaster. But also beware that this evaluates its argument twice, so no <code>x++</code>.</p>

<ul>

<pre><code class="plaintext">int  PERL_ABS(int x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_acos"><a class="permalink" href="perlapi.html#Perl_acos">#</a><code>Perl_acos</code></dt>
<dd>

</dd>
<dt id="Perl_asin"><a class="permalink" href="perlapi.html#Perl_asin">#</a><code>Perl_asin</code></dt>
<dd>

</dd>
<dt id="Perl_atan"><a class="permalink" href="perlapi.html#Perl_atan">#</a><code>Perl_atan</code></dt>
<dd>

</dd>
<dt id="Perl_atan2"><a class="permalink" href="perlapi.html#Perl_atan2">#</a><code>Perl_atan2</code></dt>
<dd>

</dd>
<dt id="Perl_ceil"><a class="permalink" href="perlapi.html#Perl_ceil">#</a><code>Perl_ceil</code></dt>
<dd>

</dd>
<dt id="Perl_cos"><a class="permalink" href="perlapi.html#Perl_cos">#</a><code>Perl_cos</code></dt>
<dd>

</dd>
<dt id="Perl_cosh"><a class="permalink" href="perlapi.html#Perl_cosh">#</a><code>Perl_cosh</code></dt>
<dd>

</dd>
<dt id="Perl_exp"><a class="permalink" href="perlapi.html#Perl_exp">#</a><code>Perl_exp</code></dt>
<dd>

</dd>
<dt id="Perl_floor"><a class="permalink" href="perlapi.html#Perl_floor">#</a><code>Perl_floor</code></dt>
<dd>

</dd>
<dt id="Perl_fmod"><a class="permalink" href="perlapi.html#Perl_fmod">#</a><code>Perl_fmod</code></dt>
<dd>

</dd>
<dt id="Perl_frexp"><a class="permalink" href="perlapi.html#Perl_frexp">#</a><code>Perl_frexp</code></dt>
<dd>

</dd>
<dt id="Perl_isfinite"><a class="permalink" href="perlapi.html#Perl_isfinite">#</a><code>Perl_isfinite</code></dt>
<dd>

</dd>
<dt id="Perl_isinf"><a class="permalink" href="perlapi.html#Perl_isinf">#</a><code>Perl_isinf</code></dt>
<dd>

</dd>
<dt id="Perl_isnan"><a class="permalink" href="perlapi.html#Perl_isnan">#</a><code>Perl_isnan</code></dt>
<dd>

</dd>
<dt id="Perl_ldexp"><a class="permalink" href="perlapi.html#Perl_ldexp">#</a><code>Perl_ldexp</code></dt>
<dd>

</dd>
<dt id="Perl_log"><a class="permalink" href="perlapi.html#Perl_log">#</a><code>Perl_log</code></dt>
<dd>

</dd>
<dt id="Perl_log10"><a class="permalink" href="perlapi.html#Perl_log10">#</a><code>Perl_log10</code></dt>
<dd>

</dd>
<dt id="Perl_modf"><a class="permalink" href="perlapi.html#Perl_modf">#</a><code>Perl_modf</code></dt>
<dd>

</dd>
<dt id="Perl_pow"><a class="permalink" href="perlapi.html#Perl_pow">#</a><code>Perl_pow</code></dt>
<dd>

</dd>
<dt id="Perl_sin"><a class="permalink" href="perlapi.html#Perl_sin">#</a><code>Perl_sin</code></dt>
<dd>

</dd>
<dt id="Perl_sinh"><a class="permalink" href="perlapi.html#Perl_sinh">#</a><code>Perl_sinh</code></dt>
<dd>

</dd>
<dt id="Perl_sqrt"><a class="permalink" href="perlapi.html#Perl_sqrt">#</a><code>Perl_sqrt</code></dt>
<dd>

</dd>
<dt id="Perl_tan"><a class="permalink" href="perlapi.html#Perl_tan">#</a><code>Perl_tan</code></dt>
<dd>

</dd>
<dt id="Perl_tanh"><a class="permalink" href="perlapi.html#Perl_tanh">#</a><code>Perl_tanh</code> </dt>
<dd>

<p>These perform the corresponding mathematical operation on the operand(s), using the libc function designed for the task that has just enough precision for an NV on this platform. If no such function with sufficient precision exists, the highest precision one available is used.</p>

<ul>

<pre><code class="plaintext">NV  Perl_acos    (NV x)
NV  Perl_asin    (NV x)
NV  Perl_atan    (NV x)
NV  Perl_atan2   (NV x, NV y)
NV  Perl_ceil    (NV x)
NV  Perl_cos     (NV x)
NV  Perl_cosh    (NV x)
NV  Perl_exp     (NV x)
NV  Perl_floor   (NV x)
NV  Perl_fmod    (NV x, NV y)
NV  Perl_frexp   (NV x, int *exp)
IV  Perl_isfinite(NV x)
IV  Perl_isinf   (NV x)
IV  Perl_isnan   (NV x)
NV  Perl_ldexp   (NV x, int exp)
NV  Perl_log     (NV x)
NV  Perl_log10   (NV x)
NV  Perl_modf    (NV x, NV *iptr)
NV  Perl_pow     (NV x, NV y)
NV  Perl_sin     (NV x)
NV  Perl_sinh    (NV x)
NV  Perl_sqrt    (NV x)
NV  Perl_tan     (NV x)
NV  Perl_tanh    (NV x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Perl_signbit"><a class="permalink" href="perlapi.html#Perl_signbit">#</a><code>Perl_signbit</code> </dt>
<dd>

<p>NOTE: <code>Perl_signbit</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Return a non-zero integer if the sign bit on an NV is set, and 0 if it is not.</p>

<p>If <i>Configure</i> detects this system has a <code>signbit()</code> that will work with our NVs, then we just use it via the <code>#define</code> in <i>perl.h</i>. Otherwise, fall back on this implementation. The main use of this function is catching <code>-0.0</code>.</p>

<p><code>Configure</code> notes: This function is called <code>&#39;Perl_signbit&#39;</code> instead of a plain <code>&#39;signbit&#39;</code> because it is easy to imagine a system having a <code>signbit()</code> function or macro that doesn&#39;t happen to work with our particular choice of NVs. We shouldn&#39;t just re-<code>#define</code> <code>signbit</code> as <code>Perl_signbit</code> and expect the standard system headers to be happy. Also, this is a no-context function (no <code>pTHX_</code>) because <code>Perl_signbit()</code> is usually re-<code>#defined</code> in <i>perl.h</i> as a simple macro call to the system&#39;s <code>signbit()</code>. Users should just always call <code>Perl_signbit()</code>.</p>

<ul>

<pre><code class="plaintext">int  Perl_signbit(NV f)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_hexdigit"><a class="permalink" href="perlapi.html#PL_hexdigit">#</a><code>PL_hexdigit</code> </dt>
<dd>

<p>This array, indexed by an integer, converts that value into the character that represents it. For example, if the input is 8, the return will be a string whose first character is &#39;8&#39;. What is actually returned is a pointer into a string. All you are interested in is the first character of that string. To get uppercase letters (for the values 10..15), add 16 to the index. Hence, <code>PL_hexdigit[11]</code> is <code>&#39;b&#39;</code>, and <code>PL_hexdigit[11+16]</code> is <code>&#39;B&#39;</code>. Adding 16 to an index whose representation is &#39;0&#39;..&#39;9&#39; yields the same as not adding 16. Indices outside the range 0..31 result in (bad) undedefined behavior.</p>

</dd>
</dl>

<dl>

<dt id="READ_XDIGIT"><a class="permalink" href="perlapi.html#READ_XDIGIT">#</a><code>READ_XDIGIT</code> </dt>
<dd>

<p>Returns the value of an ASCII-range hex digit and advances the string pointer. Behaviour is only well defined when isXDIGIT(*str) is true.</p>

<ul>

<pre><code class="plaintext">U8  READ_XDIGIT(char str*)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="scan_bin"><a class="permalink" href="perlapi.html#scan_bin">#</a><code>scan_bin</code> </dt>
<dd>

<p>For backwards compatibility. Use <code>grok_bin</code> instead.</p>

<ul>

<pre><code class="plaintext">NV  scan_bin(const char* start, STRLEN len, STRLEN* retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="scan_hex"><a class="permalink" href="perlapi.html#scan_hex">#</a><code>scan_hex</code> </dt>
<dd>

<p>For backwards compatibility. Use <code>grok_hex</code> instead.</p>

<ul>

<pre><code class="plaintext">NV  scan_hex(const char* start, STRLEN len, STRLEN* retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="scan_oct"><a class="permalink" href="perlapi.html#scan_oct">#</a><code>scan_oct</code> </dt>
<dd>

<p>For backwards compatibility. Use <code>grok_oct</code> instead.</p>

<ul>

<pre><code class="plaintext">NV  scan_oct(const char* start, STRLEN len, STRLEN* retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="seedDrand01"><a class="permalink" href="perlapi.html#seedDrand01">#</a><code>seedDrand01</code> </dt>
<dd>

<p>This symbol defines the macro to be used in seeding the random number generator (see <code><a href="perlapi.html#Drand01">&quot;Drand01&quot;</a></code>).</p>

<ul>

<pre><code class="plaintext">void  seedDrand01(Rand_seed_t x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Strtod"><a class="permalink" href="perlapi.html#Strtod">#</a><code>Strtod</code> </dt>
<dd>

<p>This is a synonym for <a href="perlapi.html#my_strtod">&quot;my_strtod&quot;</a>.</p>

<ul>

<pre><code class="plaintext">NV  Strtod(NN const char * const s, NULLOK char ** e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Strtol"><a class="permalink" href="perlapi.html#Strtol">#</a><code>Strtol</code> </dt>
<dd>

<p>Platform and configuration independent <code>strtol</code>. This expands to the appropriate <code>strotol</code>-like function based on the platform and <i>Configure</i> options&gt;. For example it could expand to <code>strtoll</code> or <code>strtoq</code> instead of <code>strtol</code>.</p>

<ul>

<pre><code class="plaintext">NV  Strtol(NN const char * const s, NULLOK char ** e, int base)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Strtoul"><a class="permalink" href="perlapi.html#Strtoul">#</a><code>Strtoul</code> </dt>
<dd>

<p>Platform and configuration independent <code>strtoul</code>. This expands to the appropriate <code>strotoul</code>-like function based on the platform and <i>Configure</i> options&gt;. For example it could expand to <code>strtoull</code> or <code>strtouq</code> instead of <code>strtoul</code>.</p>

<ul>

<pre><code class="plaintext">NV  Strtoul(NN const char * const s, NULLOK char ** e, int base)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Optree-construction"><a class="permalink" href="perlapi.html#Optree-construction">#</a><a id="Optree"></a>Optree construction</h1>

<dl>

<dt id="newASSIGNOP"><a class="permalink" href="perlapi.html#newASSIGNOP">#</a><code>newASSIGNOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an assignment op. <code>left</code> and <code>right</code> supply the parameters of the assignment; they are consumed by this function and become part of the constructed op tree.</p>

<p>If <code>optype</code> is <code>OP_ANDASSIGN</code>, <code>OP_ORASSIGN</code>, or <code>OP_DORASSIGN</code>, then a suitable conditional optree is constructed. If <code>optype</code> is the opcode of a binary operator, such as <code>OP_BIT_OR</code>, then an op is constructed that performs the binary operation and assigns the result to the left argument. Either way, if <code>optype</code> is non-zero then <code>flags</code> has no effect.</p>

<p>If <code>optype</code> is zero, then a plain scalar or list assignment is constructed. Which type of assignment it is is automatically determined. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 or 2 is automatically set as required.</p>

<ul>

<pre><code class="plaintext">OP*  newASSIGNOP(I32 flags, OP* left, I32 optype, OP* right)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newBINOP"><a class="permalink" href="perlapi.html#newBINOP">#</a><code>newBINOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any binary type. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 or 2 is automatically set as required. <code>first</code> and <code>last</code> supply up to two ops to be the direct children of the binary op; they are consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newBINOP(I32 type, I32 flags, OP* first, OP* last)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newCONDOP"><a class="permalink" href="perlapi.html#newCONDOP">#</a><code>newCONDOP</code> </dt>
<dd>

<p>Constructs, checks, and returns a conditional-expression (<code>cond_expr</code>) op. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 is automatically set. <code>first</code> supplies the expression selecting between the two branches, and <code>trueop</code> and <code>falseop</code> supply the branches; they are consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newCONDOP(I32 flags, OP* first, OP* trueop, OP* falseop)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newDEFSVOP"><a class="permalink" href="perlapi.html#newDEFSVOP">#</a><code>newDEFSVOP</code> </dt>
<dd>

<p>Constructs and returns an op to access <code>$_</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newDEFSVOP()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newFOROP"><a class="permalink" href="perlapi.html#newFOROP">#</a><code>newFOROP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op tree expressing a <code>foreach</code> loop (iteration through a list of values). This is a heavyweight loop, with structure that allows exiting the loop by <code>last</code> and suchlike.</p>

<p><code>sv</code> optionally supplies the variable that will be aliased to each item in turn; if null, it defaults to <code>$_</code>. <code>expr</code> supplies the list of values to iterate over. <code>block</code> supplies the main body of the loop, and <code>cont</code> optionally supplies a <code>continue</code> block that operates as a second half of the body. All of these optree inputs are consumed by this function and become part of the constructed op tree.</p>

<p><code>flags</code> gives the eight bits of <code>op_flags</code> for the <code>leaveloop</code> op and, shifted up eight bits, the eight bits of <code>op_private</code> for the <code>leaveloop</code> op, except that (in both cases) some bits will be set automatically.</p>

<ul>

<pre><code class="plaintext">OP*  newFOROP(I32 flags, OP* sv, OP* expr, OP* block, OP* cont)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newGIVENOP"><a class="permalink" href="perlapi.html#newGIVENOP">#</a><code>newGIVENOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op tree expressing a <code>given</code> block. <code>cond</code> supplies the expression to whose value <code>$_</code> will be locally aliased, and <code>block</code> supplies the body of the <code>given</code> construct; they are consumed by this function and become part of the constructed op tree. <code>defsv_off</code> must be zero (it used to identity the pad slot of lexical $_).</p>

<ul>

<pre><code class="plaintext">OP*  newGIVENOP(OP* cond, OP* block, PADOFFSET defsv_off)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newGVOP"><a class="permalink" href="perlapi.html#newGVOP">#</a><code>newGVOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any type that involves an embedded reference to a GV. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>. <code>gv</code> identifies the GV that the op should reference; calling this function does not transfer ownership of any reference to it.</p>

<ul>

<pre><code class="plaintext">OP*  newGVOP(I32 type, I32 flags, GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newLISTOP"><a class="permalink" href="perlapi.html#newLISTOP">#</a><code>newLISTOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any list type. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically if required. <code>first</code> and <code>last</code> supply up to two ops to be direct children of the list op; they are consumed by this function and become part of the constructed op tree.</p>

<p>For most list operators, the check function expects all the kid ops to be present already, so calling <code>newLISTOP(OP_JOIN, ...)</code> (e.g.) is not appropriate. What you want to do in that case is create an op of type <code>OP_LIST</code>, append more children to it, and then call <a href="perlapi.html#op_convert_list">&quot;op_convert_list&quot;</a>. See <a href="perlapi.html#op_convert_list">&quot;op_convert_list&quot;</a> for more information.</p>

<ul>

<pre><code class="plaintext">OP*  newLISTOP(I32 type, I32 flags, OP* first, OP* last)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newLOGOP"><a class="permalink" href="perlapi.html#newLOGOP">#</a><code>newLOGOP</code> </dt>
<dd>

<p>Constructs, checks, and returns a logical (flow control) op. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 is automatically set. <code>first</code> supplies the expression controlling the flow, and <code>other</code> supplies the side (alternate) chain of ops; they are consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newLOGOP(I32 optype, I32 flags, OP *first, OP *other)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newLOOPEX"><a class="permalink" href="perlapi.html#newLOOPEX">#</a><code>newLOOPEX</code> </dt>
<dd>

<p>Constructs, checks, and returns a loop-exiting op (such as <code>goto</code> or <code>last</code>). <code>type</code> is the opcode. <code>label</code> supplies the parameter determining the target of the op; it is consumed by this function and becomes part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newLOOPEX(I32 type, OP* label)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newLOOPOP"><a class="permalink" href="perlapi.html#newLOOPOP">#</a><code>newLOOPOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op tree expressing a loop. This is only a loop in the control flow through the op tree; it does not have the heavyweight loop structure that allows exiting the loop by <code>last</code> and suchlike. <code>flags</code> gives the eight bits of <code>op_flags</code> for the top-level op, except that some bits will be set automatically as required. <code>expr</code> supplies the expression controlling loop iteration, and <code>block</code> supplies the body of the loop; they are consumed by this function and become part of the constructed op tree. <code>debuggable</code> is currently unused and should always be 1.</p>

<ul>

<pre><code class="plaintext">OP*  newLOOPOP(I32 flags, I32 debuggable, OP* expr, OP* block)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newMETHOP"><a class="permalink" href="perlapi.html#newMETHOP">#</a><code>newMETHOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of method type with a method name evaluated at runtime. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 is automatically set. <code>dynamic_meth</code> supplies an op which evaluates method name; it is consumed by this function and become part of the constructed op tree. Supported optypes: <code>OP_METHOD</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newMETHOP(I32 type, I32 flags, OP* dynamic_meth)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newMETHOP_named"><a class="permalink" href="perlapi.html#newMETHOP_named">#</a><code>newMETHOP_named</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of method type with a constant method name. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, and, shifted up eight bits, the eight bits of <code>op_private</code>. <code>const_meth</code> supplies a constant method name; it must be a shared COW string. Supported optypes: <code>OP_METHOD_NAMED</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newMETHOP_named(I32 type, I32 flags, SV* const_meth)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newNULLLIST"><a class="permalink" href="perlapi.html#newNULLLIST">#</a><code>newNULLLIST</code> </dt>
<dd>

<p>Constructs, checks, and returns a new <code>stub</code> op, which represents an empty list expression.</p>

<ul>

<pre><code class="plaintext">OP*  newNULLLIST()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newOP"><a class="permalink" href="perlapi.html#newOP">#</a><code>newOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any base type (any type that has no extra fields). <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, and, shifted up eight bits, the eight bits of <code>op_private</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newOP(I32 optype, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPADOP"><a class="permalink" href="perlapi.html#newPADOP">#</a><code>newPADOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any type that involves a reference to a pad element. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>. A pad slot is automatically allocated, and is populated with <code>sv</code>; this function takes ownership of one reference to it.</p>

<p>This function only exists if Perl has been compiled to use ithreads.</p>

<ul>

<pre><code class="plaintext">OP*  newPADOP(I32 type, I32 flags, SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPMOP"><a class="permalink" href="perlapi.html#newPMOP">#</a><code>newPMOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any pattern matching type. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code> and, shifted up eight bits, the eight bits of <code>op_private</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newPMOP(I32 type, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newPVOP"><a class="permalink" href="perlapi.html#newPVOP">#</a><code>newPVOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any type that involves an embedded C-level pointer (PV). <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>. <code>pv</code> supplies the C-level pointer. Depending on the op type, the memory referenced by <code>pv</code> may be freed when the op is destroyed. If the op is of a freeing type, <code>pv</code> must have been allocated using <code>PerlMemShared_malloc</code>.</p>

<ul>

<pre><code class="plaintext">OP*  newPVOP(I32 type, I32 flags, char* pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newRANGE"><a class="permalink" href="perlapi.html#newRANGE">#</a><code>newRANGE</code> </dt>
<dd>

<p>Constructs and returns a <code>range</code> op, with subordinate <code>flip</code> and <code>flop</code> ops. <code>flags</code> gives the eight bits of <code>op_flags</code> for the <code>flip</code> op and, shifted up eight bits, the eight bits of <code>op_private</code> for both the <code>flip</code> and <code>range</code> ops, except that the bit with value 1 is automatically set. <code>left</code> and <code>right</code> supply the expressions controlling the endpoints of the range; they are consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newRANGE(I32 flags, OP* left, OP* right)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSLICEOP"><a class="permalink" href="perlapi.html#newSLICEOP">#</a><code>newSLICEOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an <code>lslice</code> (list slice) op. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 or 2 is automatically set as required. <code>listval</code> and <code>subscript</code> supply the parameters of the slice; they are consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newSLICEOP(I32 flags, OP* subscript, OP* listop)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSTATEOP"><a class="permalink" href="perlapi.html#newSTATEOP">#</a><code>newSTATEOP</code> </dt>
<dd>

<p>Constructs a state op (COP). The state op is normally a <code>nextstate</code> op, but will be a <code>dbstate</code> op if debugging is enabled for currently-compiled code. The state op is populated from <code>PL_curcop</code> (or <code>PL_compiling</code>). If <code>label</code> is non-null, it supplies the name of a label to attach to the state op; this function takes ownership of the memory pointed at by <code>label</code>, and will free it. <code>flags</code> gives the eight bits of <code>op_flags</code> for the state op.</p>

<p>If <code>o</code> is null, the state op is returned. Otherwise the state op is combined with <code>o</code> into a <code>lineseq</code> list op, which is returned. <code>o</code> is consumed by this function and becomes part of the returned op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newSTATEOP(I32 flags, char* label, OP* o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVOP"><a class="permalink" href="perlapi.html#newSVOP">#</a><code>newSVOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any type that involves an embedded SV. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>. <code>sv</code> gives the SV to embed in the op; this function takes ownership of one reference to it.</p>

<ul>

<pre><code class="plaintext">OP*  newSVOP(I32 type, I32 flags, SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newTRYCATCHOP"><a class="permalink" href="perlapi.html#newTRYCATCHOP">#</a><code>newTRYCATCHOP</code> </dt>
<dd>

<p>NOTE: <code>newTRYCATCHOP</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Constructs and returns a conditional execution statement that implements the <code>try</code>/<code>catch</code> semantics. First the op tree in <code>tryblock</code> is executed, inside a context that traps exceptions. If an exception occurs then the optree in <code>catchblock</code> is executed, with the trapped exception set into the lexical variable given by <code>catchvar</code> (which must be an op of type <code>OP_PADSV</code>). All the optrees are consumed by this function and become part of the returned op tree.</p>

<p>The <code>flags</code> argument is currently ignored.</p>

<ul>

<pre><code class="plaintext">OP*  newTRYCATCHOP(I32 flags, OP* tryblock, OP *catchvar,
                   OP* catchblock)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newUNOP"><a class="permalink" href="perlapi.html#newUNOP">#</a><code>newUNOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op of any unary type. <code>type</code> is the opcode. <code>flags</code> gives the eight bits of <code>op_flags</code>, except that <code>OPf_KIDS</code> will be set automatically if required, and, shifted up eight bits, the eight bits of <code>op_private</code>, except that the bit with value 1 is automatically set. <code>first</code> supplies an optional op to be the direct child of the unary op; it is consumed by this function and become part of the constructed op tree.</p>

<ul>

<pre><code class="plaintext">OP*  newUNOP(I32 type, I32 flags, OP* first)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newUNOP_AUX"><a class="permalink" href="perlapi.html#newUNOP_AUX">#</a><code>newUNOP_AUX</code> </dt>
<dd>

<p>Similar to <code>newUNOP</code>, but creates an <code>UNOP_AUX</code> struct instead, with <code>op_aux</code> initialised to <code>aux</code></p>

<ul>

<pre><code class="plaintext">OP*  newUNOP_AUX(I32 type, I32 flags, OP* first,
                 UNOP_AUX_item *aux)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newWHENOP"><a class="permalink" href="perlapi.html#newWHENOP">#</a><code>newWHENOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op tree expressing a <code>when</code> block. <code>cond</code> supplies the test expression, and <code>block</code> supplies the block that will be executed if the test evaluates to true; they are consumed by this function and become part of the constructed op tree. <code>cond</code> will be interpreted DWIMically, often as a comparison against <code>$_</code>, and may be null to generate a <code>default</code> block.</p>

<ul>

<pre><code class="plaintext">OP*  newWHENOP(OP* cond, OP* block)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newWHILEOP"><a class="permalink" href="perlapi.html#newWHILEOP">#</a><code>newWHILEOP</code> </dt>
<dd>

<p>Constructs, checks, and returns an op tree expressing a <code>while</code> loop. This is a heavyweight loop, with structure that allows exiting the loop by <code>last</code> and suchlike.</p>

<p><code>loop</code> is an optional preconstructed <code>enterloop</code> op to use in the loop; if it is null then a suitable op will be constructed automatically. <code>expr</code> supplies the loop&#39;s controlling expression. <code>block</code> supplies the main body of the loop, and <code>cont</code> optionally supplies a <code>continue</code> block that operates as a second half of the body. All of these optree inputs are consumed by this function and become part of the constructed op tree.</p>

<p><code>flags</code> gives the eight bits of <code>op_flags</code> for the <code>leaveloop</code> op and, shifted up eight bits, the eight bits of <code>op_private</code> for the <code>leaveloop</code> op, except that (in both cases) some bits will be set automatically. <code>debuggable</code> is currently unused and should always be 1. <code>has_my</code> can be supplied as true to force the loop body to be enclosed in its own scope.</p>

<ul>

<pre><code class="plaintext">OP*  newWHILEOP(I32 flags, I32 debuggable, LOOP* loop, OP* expr,
                OP* block, OP* cont, I32 has_my)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_opfreehook"><a class="permalink" href="perlapi.html#PL_opfreehook">#</a><code>PL_opfreehook</code> </dt>
<dd>

<p>When non-<code>NULL</code>, the function pointed by this variable will be called each time an OP is freed with the corresponding OP as the argument. This allows extensions to free any extra attribute they have locally attached to an OP. It is also assured to first fire for the parent OP and then for its kids.</p>

<p>When you replace this variable, it is considered a good practice to store the possibly previously installed hook and that you recall it inside your own.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">Perl_ophook_t  PL_opfreehook</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_peepp"><a class="permalink" href="perlapi.html#PL_peepp">#</a><code>PL_peepp</code> </dt>
<dd>

<p>Pointer to the per-subroutine peephole optimiser. This is a function that gets called at the end of compilation of a Perl subroutine (or equivalently independent piece of Perl code) to perform fixups of some ops and to perform small-scale optimisations. The function is called once for each subroutine that is compiled, and is passed, as sole parameter, a pointer to the op that is the entry point to the subroutine. It modifies the op tree in place.</p>

<p>The peephole optimiser should never be completely replaced. Rather, add code to it by wrapping the existing optimiser. The basic way to do this can be seen in <a href="perlguts.html#Compile-pass-3%3A-peephole-optimization">&quot;Compile pass 3: peephole optimization&quot; in perlguts</a>. If the new code wishes to operate on ops throughout the subroutine&#39;s structure, rather than just at the top level, it is likely to be more convenient to wrap the <a href="perlapi.html#PL_rpeepp">&quot;PL_rpeepp&quot;</a> hook.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">peep_t  PL_peepp</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_rpeepp"><a class="permalink" href="perlapi.html#PL_rpeepp">#</a><code>PL_rpeepp</code> </dt>
<dd>

<p>Pointer to the recursive peephole optimiser. This is a function that gets called at the end of compilation of a Perl subroutine (or equivalently independent piece of Perl code) to perform fixups of some ops and to perform small-scale optimisations. The function is called once for each chain of ops linked through their <code>op_next</code> fields; it is recursively called to handle each side chain. It is passed, as sole parameter, a pointer to the op that is at the head of the chain. It modifies the op tree in place.</p>

<p>The peephole optimiser should never be completely replaced. Rather, add code to it by wrapping the existing optimiser. The basic way to do this can be seen in <a href="perlguts.html#Compile-pass-3%3A-peephole-optimization">&quot;Compile pass 3: peephole optimization&quot; in perlguts</a>. If the new code wishes to operate only on ops at a subroutine&#39;s top level, rather than throughout the structure, it is likely to be more convenient to wrap the <a href="perlapi.html#PL_peepp">&quot;PL_peepp&quot;</a> hook.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">peep_t  PL_rpeepp</code></pre>

</ul>

</dd>
</dl>

<h1 id="Optree-Manipulation-Functions"><a class="permalink" href="perlapi.html#Optree-Manipulation-Functions">#</a><a id="Optree1"></a>Optree Manipulation Functions</h1>

<dl>

<dt id="alloccopstash"><a class="permalink" href="perlapi.html#alloccopstash">#</a><code>alloccopstash</code> </dt>
<dd>

<p>NOTE: <code>alloccopstash</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Available only under threaded builds, this function allocates an entry in <code>PL_stashpad</code> for the stash passed to it.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  alloccopstash(HV *hv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="block_end"><a class="permalink" href="perlapi.html#block_end">#</a><code>block_end</code> </dt>
<dd>

<p>Handles compile-time scope exit. <code>floor</code> is the savestack index returned by <code>block_start</code>, and <code>seq</code> is the body of the block. Returns the block, possibly modified.</p>

<ul>

<pre><code class="plaintext">OP*  block_end(I32 floor, OP* seq)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="block_start"><a class="permalink" href="perlapi.html#block_start">#</a><code>block_start</code> </dt>
<dd>

<p>Handles compile-time scope entry. Arranges for hints to be restored on block exit and also handles pad sequence numbers to make lexical variables scope right. Returns a savestack index for use with <code>block_end</code>.</p>

<ul>

<pre><code class="plaintext">int  block_start(int full)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ck_entersub_args_list"><a class="permalink" href="perlapi.html#ck_entersub_args_list">#</a><code>ck_entersub_args_list</code> </dt>
<dd>

<p>Performs the default fixup of the arguments part of an <code>entersub</code> op tree. This consists of applying list context to each of the argument ops. This is the standard treatment used on a call marked with <code>&amp;</code>, or a method call, or a call through a subroutine reference, or any other call where the callee can&#39;t be identified at compile time, or a call where the callee has no prototype.</p>

<ul>

<pre><code class="plaintext">OP*  ck_entersub_args_list(OP *entersubop)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ck_entersub_args_proto"><a class="permalink" href="perlapi.html#ck_entersub_args_proto">#</a><code>ck_entersub_args_proto</code> </dt>
<dd>

<p>Performs the fixup of the arguments part of an <code>entersub</code> op tree based on a subroutine prototype. This makes various modifications to the argument ops, from applying context up to inserting <code>refgen</code> ops, and checking the number and syntactic types of arguments, as directed by the prototype. This is the standard treatment used on a subroutine call, not marked with <code>&amp;</code>, where the callee can be identified at compile time and has a prototype.</p>

<p><code>protosv</code> supplies the subroutine prototype to be applied to the call. It may be a normal defined scalar, of which the string value will be used. Alternatively, for convenience, it may be a subroutine object (a <code>CV*</code> that has been cast to <code>SV*</code>) which has a prototype. The prototype supplied, in whichever form, does not need to match the actual callee referenced by the op tree.</p>

<p>If the argument ops disagree with the prototype, for example by having an unacceptable number of arguments, a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. In the error message, the callee is referred to by the name defined by the <code>namegv</code> parameter.</p>

<ul>

<pre><code class="plaintext">OP*  ck_entersub_args_proto(OP *entersubop, GV *namegv,
                            SV *protosv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ck_entersub_args_proto_or_list"><a class="permalink" href="perlapi.html#ck_entersub_args_proto_or_list">#</a><code>ck_entersub_args_proto_or_list</code> </dt>
<dd>

<p>Performs the fixup of the arguments part of an <code>entersub</code> op tree either based on a subroutine prototype or using default list-context processing. This is the standard treatment used on a subroutine call, not marked with <code>&amp;</code>, where the callee can be identified at compile time.</p>

<p><code>protosv</code> supplies the subroutine prototype to be applied to the call, or indicates that there is no prototype. It may be a normal scalar, in which case if it is defined then the string value will be used as a prototype, and if it is undefined then there is no prototype. Alternatively, for convenience, it may be a subroutine object (a <code>CV*</code> that has been cast to <code>SV*</code>), of which the prototype will be used if it has one. The prototype (or lack thereof) supplied, in whichever form, does not need to match the actual callee referenced by the op tree.</p>

<p>If the argument ops disagree with the prototype, for example by having an unacceptable number of arguments, a valid op tree is returned anyway. The error is reflected in the parser state, normally resulting in a single exception at the top level of parsing which covers all the compilation errors that occurred. In the error message, the callee is referred to by the name defined by the <code>namegv</code> parameter.</p>

<ul>

<pre><code class="plaintext">OP*  ck_entersub_args_proto_or_list(OP *entersubop, GV *namegv,
                                    SV *protosv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_const_sv"><a class="permalink" href="perlapi.html#cv_const_sv">#</a><code>cv_const_sv</code> </dt>
<dd>

<p>If <code>cv</code> is a constant sub eligible for inlining, returns the constant value returned by the sub. Otherwise, returns <code>NULL</code>.</p>

<p>Constant subs can be created with <code>newCONSTSUB</code> or as described in <a href="perlsub.html#Constant-Functions">&quot;Constant Functions&quot; in perlsub</a>.</p>

<ul>

<pre><code class="plaintext">SV*  cv_const_sv(const CV *const cv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_get_call_checker"><a class="permalink" href="perlapi.html#cv_get_call_checker">#</a><code>cv_get_call_checker</code> </dt>
<dd>

<p>The original form of <a href="perlapi.html#cv_get_call_checker_flags">&quot;cv_get_call_checker_flags&quot;</a>, which does not return checker flags. When using a checker function returned by this function, it is only safe to call it with a genuine GV as its <code>namegv</code> argument.</p>

<ul>

<pre><code class="plaintext">void  cv_get_call_checker(CV *cv, Perl_call_checker *ckfun_p,
                          SV **ckobj_p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_get_call_checker_flags"><a class="permalink" href="perlapi.html#cv_get_call_checker_flags">#</a><code>cv_get_call_checker_flags</code> </dt>
<dd>

<p>Retrieves the function that will be used to fix up a call to <code>cv</code>. Specifically, the function is applied to an <code>entersub</code> op tree for a subroutine call, not marked with <code>&amp;</code>, where the callee can be identified at compile time as <code>cv</code>.</p>

<p>The C-level function pointer is returned in <code>*ckfun_p</code>, an SV argument for it is returned in <code>*ckobj_p</code>, and control flags are returned in <code>*ckflags_p</code>. The function is intended to be called in this manner:</p>

<pre><code>entersubop = (*ckfun_p)(aTHX_ entersubop, namegv, (*ckobj_p));</code></pre>

<p>In this call, <code>entersubop</code> is a pointer to the <code>entersub</code> op, which may be replaced by the check function, and <code>namegv</code> supplies the name that should be used by the check function to refer to the callee of the <code>entersub</code> op if it needs to emit any diagnostics. It is permitted to apply the check function in non-standard situations, such as to a call to a different subroutine or to a method call.</p>

<p><code>namegv</code> may not actually be a GV. If the <code>CALL_CHECKER_REQUIRE_GV</code> bit is clear in <code>*ckflags_p</code>, it is permitted to pass a CV or other SV instead, anything that can be used as the first argument to <a href="perlapi.html#cv_name">&quot;cv_name&quot;</a>. If the <code>CALL_CHECKER_REQUIRE_GV</code> bit is set in <code>*ckflags_p</code> then the check function requires <code>namegv</code> to be a genuine GV.</p>

<p>By default, the check function is <a href="perlapi.html#ck_entersub_args_proto_or_list">Perl_ck_entersub_args_proto_or_list</a>, the SV parameter is <code>cv</code> itself, and the <code>CALL_CHECKER_REQUIRE_GV</code> flag is clear. This implements standard prototype processing. It can be changed, for a particular subroutine, by <a href="perlapi.html#cv_set_call_checker_flags">&quot;cv_set_call_checker_flags&quot;</a>.</p>

<p>If the <code>CALL_CHECKER_REQUIRE_GV</code> bit is set in <code>gflags</code> then it indicates that the caller only knows about the genuine GV version of <code>namegv</code>, and accordingly the corresponding bit will always be set in <code>*ckflags_p</code>, regardless of the check function&#39;s recorded requirements. If the <code>CALL_CHECKER_REQUIRE_GV</code> bit is clear in <code>gflags</code> then it indicates the caller knows about the possibility of passing something other than a GV as <code>namegv</code>, and accordingly the corresponding bit may be either set or clear in <code>*ckflags_p</code>, indicating the check function&#39;s recorded requirements.</p>

<p><code>gflags</code> is a bitset passed into <code>cv_get_call_checker_flags</code>, in which only the <code>CALL_CHECKER_REQUIRE_GV</code> bit currently has a defined meaning (for which see above). All other bits should be clear.</p>

<ul>

<pre><code class="plaintext">void  cv_get_call_checker_flags(CV *cv, U32 gflags,
                                Perl_call_checker *ckfun_p,
                                SV **ckobj_p, U32 *ckflags_p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_set_call_checker"><a class="permalink" href="perlapi.html#cv_set_call_checker">#</a><code>cv_set_call_checker</code> </dt>
<dd>

<p>The original form of <a href="perlapi.html#cv_set_call_checker_flags">&quot;cv_set_call_checker_flags&quot;</a>, which passes it the <code>CALL_CHECKER_REQUIRE_GV</code> flag for backward-compatibility. The effect of that flag setting is that the check function is guaranteed to get a genuine GV as its <code>namegv</code> argument.</p>

<ul>

<pre><code class="plaintext">void  cv_set_call_checker(CV *cv, Perl_call_checker ckfun,
                          SV *ckobj)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="cv_set_call_checker_flags"><a class="permalink" href="perlapi.html#cv_set_call_checker_flags">#</a><code>cv_set_call_checker_flags</code> </dt>
<dd>

<p>Sets the function that will be used to fix up a call to <code>cv</code>. Specifically, the function is applied to an <code>entersub</code> op tree for a subroutine call, not marked with <code>&amp;</code>, where the callee can be identified at compile time as <code>cv</code>.</p>

<p>The C-level function pointer is supplied in <code>ckfun</code>, an SV argument for it is supplied in <code>ckobj</code>, and control flags are supplied in <code>ckflags</code>. The function should be defined like this:</p>

<pre><code class="plaintext">STATIC OP * ckfun(pTHX_ OP *op, GV *namegv, SV *ckobj)</code></pre>

<p>It is intended to be called in this manner:</p>

<pre><code>entersubop = ckfun(aTHX_ entersubop, namegv, ckobj);</code></pre>

<p>In this call, <code>entersubop</code> is a pointer to the <code>entersub</code> op, which may be replaced by the check function, and <code>namegv</code> supplies the name that should be used by the check function to refer to the callee of the <code>entersub</code> op if it needs to emit any diagnostics. It is permitted to apply the check function in non-standard situations, such as to a call to a different subroutine or to a method call.</p>

<p><code>namegv</code> may not actually be a GV. For efficiency, perl may pass a CV or other SV instead. Whatever is passed can be used as the first argument to <a href="perlapi.html#cv_name">&quot;cv_name&quot;</a>. You can force perl to pass a GV by including <code>CALL_CHECKER_REQUIRE_GV</code> in the <code>ckflags</code>.</p>

<p><code>ckflags</code> is a bitset, in which only the <code>CALL_CHECKER_REQUIRE_GV</code> bit currently has a defined meaning (for which see above). All other bits should be clear.</p>

<p>The current setting for a particular CV can be retrieved by <a href="perlapi.html#cv_get_call_checker_flags">&quot;cv_get_call_checker_flags&quot;</a>.</p>

<ul>

<pre><code class="plaintext">void  cv_set_call_checker_flags(CV *cv, Perl_call_checker ckfun,
                                SV *ckobj, U32 ckflags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LINKLIST"><a class="permalink" href="perlapi.html#LINKLIST">#</a><code>LINKLIST</code> </dt>
<dd>

<p>Given the root of an optree, link the tree in execution order using the <code>op_next</code> pointers and return the first op executed. If this has already been done, it will not be redone, and <code>o-&gt;op_next</code> will be returned. If <code>o-&gt;op_next</code> is not already set, <code>o</code> should be at least an <code>UNOP</code>.</p>

<ul>

<pre><code class="plaintext">OP*  LINKLIST(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newATTRSUB"><a class="permalink" href="perlapi.html#newATTRSUB">#</a><code>newATTRSUB</code> </dt>
<dd>

<p>Construct a Perl subroutine, also performing some surrounding jobs.</p>

<p>This is the same as <a href="perlintern.html#newATTRSUB_x">&quot;<code>newATTRSUB_x</code>&quot; in perlintern</a> with its <code>o_is_gv</code> parameter set to FALSE. This means that if <code>o</code> is null, the new sub will be anonymous; otherwise the name will be derived from <code>o</code> in the way described (as with all other details) in <a href="perlintern.html#newATTRSUB_x">&quot;<code>newATTRSUB_x</code>&quot; in perlintern</a>.</p>

<ul>

<pre><code class="plaintext">CV*  newATTRSUB(I32 floor, OP *o, OP *proto, OP *attrs, OP *block)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newCONSTSUB"><a class="permalink" href="perlapi.html#newCONSTSUB">#</a><code>newCONSTSUB</code> </dt>
<dd>

<p>Behaves like <a href="perlapi.html#newCONSTSUB_flags">&quot;newCONSTSUB_flags&quot;</a>, except that <code>name</code> is nul-terminated rather than of counted length, and no flags are set. (This means that <code>name</code> is always interpreted as Latin-1.)</p>

<ul>

<pre><code class="plaintext">CV*  newCONSTSUB(HV* stash, const char* name, SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newCONSTSUB_flags"><a class="permalink" href="perlapi.html#newCONSTSUB_flags">#</a><code>newCONSTSUB_flags</code> </dt>
<dd>

<p>Construct a constant subroutine, also performing some surrounding jobs. A scalar constant-valued subroutine is eligible for inlining at compile-time, and in Perl code can be created by <span style="white-space: nowrap;"><code>sub FOO () { 123 }</code></span>. Other kinds of constant subroutine have other treatment.</p>

<p>The subroutine will have an empty prototype and will ignore any arguments when called. Its constant behaviour is determined by <code>sv</code>. If <code>sv</code> is null, the subroutine will yield an empty list. If <code>sv</code> points to a scalar, the subroutine will always yield that scalar. If <code>sv</code> points to an array, the subroutine will always yield a list of the elements of that array in list context, or the number of elements in the array in scalar context. This function takes ownership of one counted reference to the scalar or array, and will arrange for the object to live as long as the subroutine does. If <code>sv</code> points to a scalar then the inlining assumes that the value of the scalar will never change, so the caller must ensure that the scalar is not subsequently written to. If <code>sv</code> points to an array then no such assumption is made, so it is ostensibly safe to mutate the array or its elements, but whether this is really supported has not been determined.</p>

<p>The subroutine will have <code>CvFILE</code> set according to <code>PL_curcop</code>. Other aspects of the subroutine will be left in their default state. The caller is free to mutate the subroutine beyond its initial state after this function has returned.</p>

<p>If <code>name</code> is null then the subroutine will be anonymous, with its <code>CvGV</code> referring to an <code>__ANON__</code> glob. If <code>name</code> is non-null then the subroutine will be named accordingly, referenced by the appropriate glob. <code>name</code> is a string of length <code>len</code> bytes giving a sigilless symbol name, in UTF-8 if <code>flags</code> has the <code>SVf_UTF8</code> bit set and in Latin-1 otherwise. The name may be either qualified or unqualified. If the name is unqualified then it defaults to being in the stash specified by <code>stash</code> if that is non-null, or to <code>PL_curstash</code> if <code>stash</code> is null. The symbol is always added to the stash if necessary, with <code>GV_ADDMULTI</code> semantics.</p>

<p><code>flags</code> should not have bits set other than <code>SVf_UTF8</code>.</p>

<p>If there is already a subroutine of the specified name, then the new sub will replace the existing one in the glob. A warning may be generated about the redefinition.</p>

<p>If the subroutine has one of a few special names, such as <code>BEGIN</code> or <code>END</code>, then it will be claimed by the appropriate queue for automatic running of phase-related subroutines. In this case the relevant glob will be left not containing any subroutine, even if it did contain one before. Execution of the subroutine will likely be a no-op, unless <code>sv</code> was a tied array or the caller modified the subroutine in some interesting way before it was executed. In the case of <code>BEGIN</code>, the treatment is buggy: the sub will be executed when only half built, and may be deleted prematurely, possibly causing a crash.</p>

<p>The function returns a pointer to the constructed subroutine. If the sub is anonymous then ownership of one counted reference to the subroutine is transferred to the caller. If the sub is named then the caller does not get ownership of a reference. In most such cases, where the sub has a non-phase name, the sub will be alive at the point it is returned by virtue of being contained in the glob that names it. A phase-named subroutine will usually be alive by virtue of the reference owned by the phase&#39;s automatic run queue. A <code>BEGIN</code> subroutine may have been destroyed already by the time this function returns, but currently bugs occur in that case before the caller gets control. It is the caller&#39;s responsibility to ensure that it knows which of these situations applies.</p>

<ul>

<pre><code class="plaintext">CV*  newCONSTSUB_flags(HV* stash, const char* name, STRLEN len,
                       U32 flags, SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSUB"><a class="permalink" href="perlapi.html#newSUB">#</a><code>newSUB</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#newATTRSUB">&quot;newATTRSUB&quot;</a></code>, but without attributes.</p>

<ul>

<pre><code class="plaintext">CV*  newSUB(I32 floor, OP* o, OP* proto, OP* block)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newXS"><a class="permalink" href="perlapi.html#newXS">#</a><code>newXS</code> </dt>
<dd>

<p>Used by <code>xsubpp</code> to hook up XSUBs as Perl subs. <code>filename</code> needs to be static storage, as it is used directly as CvFILE(), without a copy being made.</p>

</dd>
</dl>

<dl>

<dt id="op_append_elem"><a class="permalink" href="perlapi.html#op_append_elem">#</a><code>op_append_elem</code> </dt>
<dd>

<p>Append an item to the list of ops contained directly within a list-type op, returning the lengthened list. <code>first</code> is the list-type op, and <code>last</code> is the op to append to the list. <code>optype</code> specifies the intended opcode for the list. If <code>first</code> is not already a list of the right type, it will be upgraded into one. If either <code>first</code> or <code>last</code> is null, the other is returned unchanged.</p>

<ul>

<pre><code class="plaintext">OP*  op_append_elem(I32 optype, OP* first, OP* last)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_append_list"><a class="permalink" href="perlapi.html#op_append_list">#</a><code>op_append_list</code> </dt>
<dd>

<p>Concatenate the lists of ops contained directly within two list-type ops, returning the combined list. <code>first</code> and <code>last</code> are the list-type ops to concatenate. <code>optype</code> specifies the intended opcode for the list. If either <code>first</code> or <code>last</code> is not already a list of the right type, it will be upgraded into one. If either <code>first</code> or <code>last</code> is null, the other is returned unchanged.</p>

<ul>

<pre><code class="plaintext">OP*  op_append_list(I32 optype, OP* first, OP* last)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OP_CLASS"><a class="permalink" href="perlapi.html#OP_CLASS">#</a><code>OP_CLASS</code> </dt>
<dd>

<p>Return the class of the provided OP: that is, which of the *OP structures it uses. For core ops this currently gets the information out of <code>PL_opargs</code>, which does not always accurately reflect the type used; in v5.26 onwards, see also the function <code><a href="perlapi.html#op_class">&quot;op_class&quot;</a></code> which can do a better job of determining the used type.</p>

<p>For custom ops the type is returned from the registration, and it is up to the registree to ensure it is accurate. The value returned will be one of the <code>OA_</code>* constants from <i>op.h</i>.</p>

<ul>

<pre><code class="plaintext">U32  OP_CLASS(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_contextualize"><a class="permalink" href="perlapi.html#op_contextualize">#</a><code>op_contextualize</code> </dt>
<dd>

<p>Applies a syntactic context to an op tree representing an expression. <code>o</code> is the op tree, and <code>context</code> must be <code>G_SCALAR</code>, <code>G_ARRAY</code>, or <code>G_VOID</code> to specify the context to apply. The modified op tree is returned.</p>

<ul>

<pre><code class="plaintext">OP*  op_contextualize(OP* o, I32 context)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_convert_list"><a class="permalink" href="perlapi.html#op_convert_list">#</a><code>op_convert_list</code> </dt>
<dd>

<p>Converts <code>o</code> into a list op if it is not one already, and then converts it into the specified <code>type</code>, calling its check function, allocating a target if it needs one, and folding constants.</p>

<p>A list-type op is usually constructed one kid at a time via <code>newLISTOP</code>, <code>op_prepend_elem</code> and <code>op_append_elem</code>. Then finally it is passed to <code>op_convert_list</code> to make it the right type.</p>

<ul>

<pre><code class="plaintext">OP*  op_convert_list(I32 optype, I32 flags, OP* o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OP_DESC"><a class="permalink" href="perlapi.html#OP_DESC">#</a><code>OP_DESC</code> </dt>
<dd>

<p>Return a short description of the provided OP.</p>

<ul>

<pre><code class="plaintext">const char *  OP_DESC(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_free"><a class="permalink" href="perlapi.html#op_free">#</a><code>op_free</code> </dt>
<dd>

<p>Free an op and its children. Only use this when an op is no longer linked to from any optree.</p>

<ul>

<pre><code class="plaintext">void  op_free(OP* arg)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OpHAS_SIBLING"><a class="permalink" href="perlapi.html#OpHAS_SIBLING">#</a><code>OpHAS_SIBLING</code> </dt>
<dd>

<p>Returns true if <code>o</code> has a sibling</p>

<ul>

<pre><code class="plaintext">bool  OpHAS_SIBLING(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OpLASTSIB_set"><a class="permalink" href="perlapi.html#OpLASTSIB_set">#</a><code>OpLASTSIB_set</code> </dt>
<dd>

<p>Marks <code>o</code> as having no further siblings and marks o as having the specified parent. See also <code><a href="perlapi.html#OpMORESIB_set">&quot;OpMORESIB_set&quot;</a></code> and <code>OpMAYBESIB_set</code>. For a higher-level interface, see <code><a href="perlapi.html#op_sibling_splice">&quot;op_sibling_splice&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  OpLASTSIB_set(OP *o, OP *parent)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_linklist"><a class="permalink" href="perlapi.html#op_linklist">#</a><code>op_linklist</code> </dt>
<dd>

<p>This function is the implementation of the <a href="perlapi.html#LINKLIST">&quot;LINKLIST&quot;</a> macro. It should not be called directly.</p>

<ul>

<pre><code class="plaintext">OP*  op_linklist(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_lvalue"><a class="permalink" href="perlapi.html#op_lvalue">#</a><code>op_lvalue</code> </dt>
<dd>

<p>NOTE: <code>op_lvalue</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Propagate lvalue (&quot;modifiable&quot;) context to an op and its children. <code>type</code> represents the context type, roughly based on the type of op that would do the modifying, although <code>local()</code> is represented by <code>OP_NULL</code>, because it has no op type of its own (it is signalled by a flag on the lvalue op).</p>

<p>This function detects things that can&#39;t be modified, such as <code>$x+1</code>, and generates errors for them. For example, <code>$x+1 = 2</code> would cause it to be called with an op of type <code>OP_ADD</code> and a <code>type</code> argument of <code>OP_SASSIGN</code>.</p>

<p>It also flags things that need to behave specially in an lvalue context, such as <code>$$x = 5</code> which might have to vivify a reference in <code>$x</code>.</p>

<ul>

<pre><code class="plaintext">OP*  op_lvalue(OP* o, I32 type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OpMAYBESIB_set"><a class="permalink" href="perlapi.html#OpMAYBESIB_set">#</a><code>OpMAYBESIB_set</code> </dt>
<dd>

<p>Conditionally does <code>OpMORESIB_set</code> or <code>OpLASTSIB_set</code> depending on whether <code>sib</code> is non-null. For a higher-level interface, see <code><a href="perlapi.html#op_sibling_splice">&quot;op_sibling_splice&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  OpMAYBESIB_set(OP *o, OP *sib, OP *parent)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OpMORESIB_set"><a class="permalink" href="perlapi.html#OpMORESIB_set">#</a><code>OpMORESIB_set</code> </dt>
<dd>

<p>Sets the sibling of <code>o</code> to the non-zero value <code>sib</code>. See also <code><a href="perlapi.html#OpLASTSIB_set">&quot;OpLASTSIB_set&quot;</a></code> and <code><a href="perlapi.html#OpMAYBESIB_set">&quot;OpMAYBESIB_set&quot;</a></code>. For a higher-level interface, see <code><a href="perlapi.html#op_sibling_splice">&quot;op_sibling_splice&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  OpMORESIB_set(OP *o, OP *sib)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OP_NAME"><a class="permalink" href="perlapi.html#OP_NAME">#</a><code>OP_NAME</code> </dt>
<dd>

<p>Return the name of the provided OP. For core ops this looks up the name from the op_type; for custom ops from the op_ppaddr.</p>

<ul>

<pre><code class="plaintext">const char *  OP_NAME(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_null"><a class="permalink" href="perlapi.html#op_null">#</a><code>op_null</code> </dt>
<dd>

<p>Neutralizes an op when it is no longer needed, but is still linked to from other ops.</p>

<ul>

<pre><code class="plaintext">void  op_null(OP* o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_parent"><a class="permalink" href="perlapi.html#op_parent">#</a><code>op_parent</code> </dt>
<dd>

<p>Returns the parent OP of <code>o</code>, if it has a parent. Returns <code>NULL</code> otherwise.</p>

<ul>

<pre><code class="plaintext">OP*  op_parent(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_prepend_elem"><a class="permalink" href="perlapi.html#op_prepend_elem">#</a><code>op_prepend_elem</code> </dt>
<dd>

<p>Prepend an item to the list of ops contained directly within a list-type op, returning the lengthened list. <code>first</code> is the op to prepend to the list, and <code>last</code> is the list-type op. <code>optype</code> specifies the intended opcode for the list. If <code>last</code> is not already a list of the right type, it will be upgraded into one. If either <code>first</code> or <code>last</code> is null, the other is returned unchanged.</p>

<ul>

<pre><code class="plaintext">OP*  op_prepend_elem(I32 optype, OP* first, OP* last)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_scope"><a class="permalink" href="perlapi.html#op_scope">#</a><code>op_scope</code> </dt>
<dd>

<p>NOTE: <code>op_scope</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Wraps up an op tree with some additional ops so that at runtime a dynamic scope will be created. The original ops run in the new dynamic scope, and then, provided that they exit normally, the scope will be unwound. The additional ops used to create and unwind the dynamic scope will normally be an <code>enter</code>/<code>leave</code> pair, but a <code>scope</code> op may be used instead if the ops are simple enough to not need the full dynamic scope structure.</p>

<ul>

<pre><code class="plaintext">OP*  op_scope(OP* o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OpSIBLING"><a class="permalink" href="perlapi.html#OpSIBLING">#</a><code>OpSIBLING</code> </dt>
<dd>

<p>Returns the sibling of <code>o</code>, or <code>NULL</code> if there is no sibling</p>

<ul>

<pre><code class="plaintext">OP*  OpSIBLING(OP *o)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="op_sibling_splice"><a class="permalink" href="perlapi.html#op_sibling_splice">#</a><code>op_sibling_splice</code> </dt>
<dd>

<p>A general function for editing the structure of an existing chain of op_sibling nodes. By analogy with the perl-level <code>splice()</code> function, allows you to delete zero or more sequential nodes, replacing them with zero or more different nodes. Performs the necessary op_first/op_last housekeeping on the parent node and op_sibling manipulation on the children. The last deleted node will be marked as the last node by updating the op_sibling/op_sibparent or op_moresib field as appropriate.</p>

<p>Note that op_next is not manipulated, and nodes are not freed; that is the responsibility of the caller. It also won&#39;t create a new list op for an empty list etc; use higher-level functions like op_append_elem() for that.</p>

<p><code>parent</code> is the parent node of the sibling chain. It may passed as <code>NULL</code> if the splicing doesn&#39;t affect the first or last op in the chain.</p>

<p><code>start</code> is the node preceding the first node to be spliced. Node(s) following it will be deleted, and ops will be inserted after it. If it is <code>NULL</code>, the first node onwards is deleted, and nodes are inserted at the beginning.</p>

<p><code>del_count</code> is the number of nodes to delete. If zero, no nodes are deleted. If -1 or greater than or equal to the number of remaining kids, all remaining kids are deleted.</p>

<p><code>insert</code> is the first of a chain of nodes to be inserted in place of the nodes. If <code>NULL</code>, no nodes are inserted.</p>

<p>The head of the chain of deleted ops is returned, or <code>NULL</code> if no ops were deleted.</p>

<p>For example:</p>

<pre><code class="plaintext">action                    before      after         returns
------                    -----       -----         -------

                          P           P
splice(P, A, 2, X-Y-Z)    |           |             B-C
                          A-B-C-D     A-X-Y-Z-D

                          P           P
splice(P, NULL, 1, X-Y)   |           |             A
                          A-B-C-D     X-Y-B-C-D

                          P           P
splice(P, NULL, 3, NULL)  |           |             A-B-C
                          A-B-C-D     D

                          P           P
splice(P, B, 0, X-Y)      |           |             NULL
                          A-B-C-D     A-B-X-Y-C-D</code></pre>

<p>For lower-level direct manipulation of <code>op_sibparent</code> and <code>op_moresib</code>, see <code><a href="perlapi.html#OpMORESIB_set">&quot;OpMORESIB_set&quot;</a></code>, <code><a href="perlapi.html#OpLASTSIB_set">&quot;OpLASTSIB_set&quot;</a></code>, <code><a href="perlapi.html#OpMAYBESIB_set">&quot;OpMAYBESIB_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">OP*  op_sibling_splice(OP *parent, OP *start, int del_count,
                       OP* insert)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OP_TYPE_IS"><a class="permalink" href="perlapi.html#OP_TYPE_IS">#</a><code>OP_TYPE_IS</code> </dt>
<dd>

<p>Returns true if the given OP is not a <code>NULL</code> pointer and if it is of the given type.</p>

<p>The negation of this macro, <code>OP_TYPE_ISNT</code> is also available as well as <code>OP_TYPE_IS_NN</code> and <code>OP_TYPE_ISNT_NN</code> which elide the NULL pointer check.</p>

<ul>

<pre><code class="plaintext">bool  OP_TYPE_IS(OP *o, Optype type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="OP_TYPE_IS_OR_WAS"><a class="permalink" href="perlapi.html#OP_TYPE_IS_OR_WAS">#</a><code>OP_TYPE_IS_OR_WAS</code> </dt>
<dd>

<p>Returns true if the given OP is not a NULL pointer and if it is of the given type or used to be before being replaced by an OP of type OP_NULL.</p>

<p>The negation of this macro, <code>OP_TYPE_ISNT_AND_WASNT</code> is also available as well as <code>OP_TYPE_IS_OR_WAS_NN</code> and <code>OP_TYPE_ISNT_AND_WASNT_NN</code> which elide the <code>NULL</code> pointer check.</p>

<ul>

<pre><code class="plaintext">bool  OP_TYPE_IS_OR_WAS(OP *o, Optype type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="rv2cv_op_cv"><a class="permalink" href="perlapi.html#rv2cv_op_cv">#</a><code>rv2cv_op_cv</code> </dt>
<dd>

<p>Examines an op, which is expected to identify a subroutine at runtime, and attempts to determine at compile time which subroutine it identifies. This is normally used during Perl compilation to determine whether a prototype can be applied to a function call. <code>cvop</code> is the op being considered, normally an <code>rv2cv</code> op. A pointer to the identified subroutine is returned, if it could be determined statically, and a null pointer is returned if it was not possible to determine statically.</p>

<p>Currently, the subroutine can be identified statically if the RV that the <code>rv2cv</code> is to operate on is provided by a suitable <code>gv</code> or <code>const</code> op. A <code>gv</code> op is suitable if the GV&#39;s CV slot is populated. A <code>const</code> op is suitable if the constant value must be an RV pointing to a CV. Details of this process may change in future versions of Perl. If the <code>rv2cv</code> op has the <code>OPpENTERSUB_AMPER</code> flag set then no attempt is made to identify the subroutine statically: this flag is used to suppress compile-time magic on a subroutine call, forcing it to use default runtime behaviour.</p>

<p>If <code>flags</code> has the bit <code>RV2CVOPCV_MARK_EARLY</code> set, then the handling of a GV reference is modified. If a GV was examined and its CV slot was found to be empty, then the <code>gv</code> op has the <code>OPpEARLY_CV</code> flag set. If the op is not optimised away, and the CV slot is later populated with a subroutine having a prototype, that flag eventually triggers the warning &quot;called too early to check prototype&quot;.</p>

<p>If <code>flags</code> has the bit <code>RV2CVOPCV_RETURN_NAME_GV</code> set, then instead of returning a pointer to the subroutine it returns a pointer to the GV giving the most appropriate name for the subroutine in this context. Normally this is just the <code>CvGV</code> of the subroutine, but for an anonymous (<code>CvANON</code>) subroutine that is referenced through a GV it will be the referencing GV. The resulting <code>GV*</code> is cast to <code>CV*</code> to be returned. A null pointer is returned as usual if there is no statically-determinable subroutine.</p>

<ul>

<pre><code class="plaintext">CV*  rv2cv_op_cv(OP *cvop, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Pack-and-Unpack"><a class="permalink" href="perlapi.html#Pack-and-Unpack">#</a><a id="Pack"></a>Pack and Unpack</h1>

<dl>

<dt id="pack_cat"><a class="permalink" href="perlapi.html#pack_cat">#</a><code>pack_cat</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>pack_cat</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>The engine implementing <code>pack()</code> Perl function. Note: parameters <code>next_in_list</code> and <code>flags</code> are not used. This call should not be used; use <code><a href="perlapi.html#packlist">&quot;packlist&quot;</a></code> instead.</p>

<ul>

<pre><code class="plaintext">void  pack_cat(SV *cat, const char *pat, const char *patend,
               SV **beglist, SV **endlist, SV ***next_in_list,
               U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="packlist"><a class="permalink" href="perlapi.html#packlist">#</a><code>packlist</code> </dt>
<dd>

<p>The engine implementing <code>pack()</code> Perl function.</p>

<ul>

<pre><code class="plaintext">void  packlist(SV *cat, const char *pat, const char *patend,
               SV **beglist, SV **endlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="unpack_str"><a class="permalink" href="perlapi.html#unpack_str">#</a><code>unpack_str</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>unpack_str</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>The engine implementing <code>unpack()</code> Perl function. Note: parameters <code>strbeg</code>, <code>new_s</code> and <code>ocnt</code> are not used. This call should not be used, use <code>unpackstring</code> instead.</p>

<ul>

<pre><code class="plaintext">SSize_t  unpack_str(const char *pat, const char *patend,
                    const char *s, const char *strbeg,
                    const char *strend, char **new_s, I32 ocnt,
                    U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="unpackstring"><a class="permalink" href="perlapi.html#unpackstring">#</a><code>unpackstring</code> </dt>
<dd>

<p>The engine implementing the <code>unpack()</code> Perl function.</p>

<p>Using the template <code>pat..patend</code>, this function unpacks the string <code>s..strend</code> into a number of mortal SVs, which it pushes onto the perl argument (<code>@_</code>) stack (so you will need to issue a <code>PUTBACK</code> before and <code>SPAGAIN</code> after the call to this function). It returns the number of pushed elements.</p>

<p>The <code>strend</code> and <code>patend</code> pointers should point to the byte following the last character of each string.</p>

<p>Although this function returns its values on the perl argument stack, it doesn&#39;t take any parameters from that stack (and thus in particular there&#39;s no need to do a <code>PUSHMARK</code> before calling it, unlike <a href="perlapi.html#call_pv">&quot;call_pv&quot;</a> for example).</p>

<ul>

<pre><code class="plaintext">SSize_t  unpackstring(const char *pat, const char *patend,
                      const char *s, const char *strend,
                      U32 flags)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Pad-Data-Structures"><a class="permalink" href="perlapi.html#Pad-Data-Structures">#</a><a id="Pad"></a>Pad Data Structures</h1>

<dl>

<dt id="CvPADLIST"><a class="permalink" href="perlapi.html#CvPADLIST">#</a><code>CvPADLIST</code> </dt>
<dd>

<p>NOTE: <code>CvPADLIST</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>CV&#39;s can have CvPADLIST(cv) set to point to a PADLIST. This is the CV&#39;s scratchpad, which stores lexical variables and opcode temporary and per-thread values.</p>

<p>For these purposes &quot;formats&quot; are a kind-of CV; eval&quot;&quot;s are too (except they&#39;re not callable at will and are always thrown away after the eval&quot;&quot; is done executing). Require&#39;d files are simply evals without any outer lexical scope.</p>

<p>XSUBs do not have a <code>CvPADLIST</code>. <code>dXSTARG</code> fetches values from <code>PL_curpad</code>, but that is really the callers pad (a slot of which is allocated by every entersub). Do not get or set <code>CvPADLIST</code> if a CV is an XSUB (as determined by <code>CvISXSUB()</code>), <code>CvPADLIST</code> slot is reused for a different internal purpose in XSUBs.</p>

<p>The PADLIST has a C array where pads are stored.</p>

<p>The 0th entry of the PADLIST is a PADNAMELIST which represents the &quot;names&quot; or rather the &quot;static type information&quot; for lexicals. The individual elements of a PADNAMELIST are PADNAMEs. Future refactorings might stop the PADNAMELIST from being stored in the PADLIST&#39;s array, so don&#39;t rely on it. See <a href="perlapi.html#PadlistNAMES">&quot;PadlistNAMES&quot;</a>.</p>

<p>The CvDEPTH&#39;th entry of a PADLIST is a PAD (an AV) which is the stack frame at that depth of recursion into the CV. The 0th slot of a frame AV is an AV which is <code>@_</code>. Other entries are storage for variables and op targets.</p>

<p>Iterating over the PADNAMELIST iterates over all possible pad items. Pad slots for targets (<code>SVs_PADTMP</code>) and GVs end up having &amp;PL_padname_undef &quot;names&quot;, while slots for constants have <code>&amp;PL_padname_const</code> &quot;names&quot; (see <code><a href="perlapi.html#pad_alloc">&quot;pad_alloc&quot;</a></code>). That <code>&amp;PL_padname_undef</code> and <code>&amp;PL_padname_const</code> are used is an implementation detail subject to change. To test for them, use <code>!PadnamePV(name)</code> and <span style="white-space: nowrap;"><code>PadnamePV(name) &amp;&amp; !PadnameLEN(name)</code></span>, respectively.</p>

<p>Only <code>my</code>/<code>our</code> variable slots get valid names. The rest are op targets/GVs/constants which are statically allocated or resolved at compile time. These don&#39;t have names by which they can be looked up from Perl code at run time through eval&quot;&quot; the way <code>my</code>/<code>our</code> variables can be. Since they can&#39;t be looked up by &quot;name&quot; but only by their index allocated at compile time (which is usually in <code>PL_op-&gt;op_targ</code>), wasting a name SV for them doesn&#39;t make sense.</p>

<p>The pad names in the PADNAMELIST have their PV holding the name of the variable. The <code>COP_SEQ_RANGE_LOW</code> and <code>_HIGH</code> fields form a range (low+1..high inclusive) of cop_seq numbers for which the name is valid. During compilation, these fields may hold the special value PERL_PADSEQ_INTRO to indicate various stages:</p>

<pre><code>COP_SEQ_RANGE_LOW        _HIGH
-----------------        -----
PERL_PADSEQ_INTRO            0   variable not yet introduced:
                                 { my ($x
valid-seq#   PERL_PADSEQ_INTRO   variable in scope:
                                 { my ($x);
valid-seq#          valid-seq#   compilation of scope complete:
                                 { my ($x); .... }</code></pre>

<p>When a lexical var hasn&#39;t yet been introduced, it already exists from the perspective of duplicate declarations, but not for variable lookups, e.g.</p>

<pre><code>my ($x, $x); # &#39;&quot;my&quot; variable $x masks earlier declaration&#39;
my $x = $x;  # equal to my $x = $::x;</code></pre>

<p>For typed lexicals <code>PadnameTYPE</code> points at the type stash. For <code>our</code> lexicals, <code>PadnameOURSTASH</code> points at the stash of the associated global (so that duplicate <code>our</code> declarations in the same package can be detected). <code>PadnameGEN</code> is sometimes used to store the generation number during compilation.</p>

<p>If <code>PadnameOUTER</code> is set on the pad name, then that slot in the frame AV is a REFCNT&#39;ed reference to a lexical from &quot;outside&quot;. Such entries are sometimes referred to as &#39;fake&#39;. In this case, the name does not use &#39;low&#39; and &#39;high&#39; to store a cop_seq range, since it is in scope throughout. Instead &#39;high&#39; stores some flags containing info about the real lexical (is it declared in an anon, and is it capable of being instantiated multiple times?), and for fake ANONs, &#39;low&#39; contains the index within the parent&#39;s pad where the lexical&#39;s value is stored, to make cloning quicker.</p>

<p>If the &#39;name&#39; is <code>&amp;</code> the corresponding entry in the PAD is a CV representing a possible closure.</p>

<p>Note that formats are treated as anon subs, and are cloned each time write is called (if necessary).</p>

<p>The flag <code>SVs_PADSTALE</code> is cleared on lexicals each time the <code>my()</code> is executed, and set on scope exit. This allows the <code>&quot;Variable $x is not available&quot;</code> warning to be generated in evals, such as</p>

<pre><code>{ my $x = 1; sub f { eval &#39;$x&#39;} } f();</code></pre>

<p>For state vars, <code>SVs_PADSTALE</code> is overloaded to mean &#39;not yet initialised&#39;, but this internal state is stored in a separate pad entry.</p>

<ul>

<pre><code class="plaintext">PADLIST *  CvPADLIST(CV *cv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_add_name_pvs"><a class="permalink" href="perlapi.html#pad_add_name_pvs">#</a><code>pad_add_name_pvs</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_add_name_pvn">&quot;pad_add_name_pvn&quot;</a>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_add_name_pvs(&quot;name&quot;, U32 flags, HV *typestash,
                            HV *ourstash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadARRAY"><a class="permalink" href="perlapi.html#PadARRAY">#</a><code>PadARRAY</code> </dt>
<dd>

<p>NOTE: <code>PadARRAY</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The C array of pad entries.</p>

<ul>

<pre><code class="plaintext">SV **  PadARRAY(PAD * pad)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_findmy_pvs"><a class="permalink" href="perlapi.html#pad_findmy_pvs">#</a><code>pad_findmy_pvs</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#pad_findmy_pvn">&quot;pad_findmy_pvn&quot;</a>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">PADOFFSET  pad_findmy_pvs(&quot;name&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistARRAY"><a class="permalink" href="perlapi.html#PadlistARRAY">#</a><code>PadlistARRAY</code> </dt>
<dd>

<p>NOTE: <code>PadlistARRAY</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The C array of a padlist, containing the pads. Only subscript it with numbers &gt;= 1, as the 0th entry is not guaranteed to remain usable.</p>

<ul>

<pre><code class="plaintext">PAD **  PadlistARRAY(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistMAX"><a class="permalink" href="perlapi.html#PadlistMAX">#</a><code>PadlistMAX</code> </dt>
<dd>

<p>NOTE: <code>PadlistMAX</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The index of the last allocated space in the padlist. Note that the last pad may be in an earlier slot. Any entries following it will be <code>NULL</code> in that case.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadlistMAX(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistNAMES"><a class="permalink" href="perlapi.html#PadlistNAMES">#</a><code>PadlistNAMES</code> </dt>
<dd>

<p>NOTE: <code>PadlistNAMES</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The names associated with pad entries.</p>

<ul>

<pre><code class="plaintext">PADNAMELIST *  PadlistNAMES(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistNAMESARRAY"><a class="permalink" href="perlapi.html#PadlistNAMESARRAY">#</a><code>PadlistNAMESARRAY</code> </dt>
<dd>

<p>NOTE: <code>PadlistNAMESARRAY</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The C array of pad names.</p>

<ul>

<pre><code class="plaintext">PADNAME **  PadlistNAMESARRAY(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistNAMESMAX"><a class="permalink" href="perlapi.html#PadlistNAMESMAX">#</a><code>PadlistNAMESMAX</code> </dt>
<dd>

<p>NOTE: <code>PadlistNAMESMAX</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The index of the last pad name.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadlistNAMESMAX(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadlistREFCNT"><a class="permalink" href="perlapi.html#PadlistREFCNT">#</a><code>PadlistREFCNT</code> </dt>
<dd>

<p>NOTE: <code>PadlistREFCNT</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The reference count of the padlist. Currently this is always 1.</p>

<ul>

<pre><code class="plaintext">U32  PadlistREFCNT(PADLIST * padlist)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadMAX"><a class="permalink" href="perlapi.html#PadMAX">#</a><code>PadMAX</code> </dt>
<dd>

<p>NOTE: <code>PadMAX</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The index of the last pad entry.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadMAX(PAD * pad)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnameLEN"><a class="permalink" href="perlapi.html#PadnameLEN">#</a><code>PadnameLEN</code> </dt>
<dd>

<p>NOTE: <code>PadnameLEN</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The length of the name.</p>

<ul>

<pre><code class="plaintext">STRLEN  PadnameLEN(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnamelistARRAY"><a class="permalink" href="perlapi.html#PadnamelistARRAY">#</a><code>PadnamelistARRAY</code> </dt>
<dd>

<p>NOTE: <code>PadnamelistARRAY</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The C array of pad names.</p>

<ul>

<pre><code class="plaintext">PADNAME **  PadnamelistARRAY(PADNAMELIST * pnl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnamelistMAX"><a class="permalink" href="perlapi.html#PadnamelistMAX">#</a><code>PadnamelistMAX</code> </dt>
<dd>

<p>NOTE: <code>PadnamelistMAX</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The index of the last pad name.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadnamelistMAX(PADNAMELIST * pnl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnamelistREFCNT"><a class="permalink" href="perlapi.html#PadnamelistREFCNT">#</a><code>PadnamelistREFCNT</code> </dt>
<dd>

<p>NOTE: <code>PadnamelistREFCNT</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The reference count of the pad name list.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadnamelistREFCNT(PADNAMELIST * pnl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnamelistREFCNT_dec"><a class="permalink" href="perlapi.html#PadnamelistREFCNT_dec">#</a><code>PadnamelistREFCNT_dec</code> </dt>
<dd>

<p>NOTE: <code>PadnamelistREFCNT_dec</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Lowers the reference count of the pad name list.</p>

<ul>

<pre><code class="plaintext">void  PadnamelistREFCNT_dec(PADNAMELIST * pnl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnamePV"><a class="permalink" href="perlapi.html#PadnamePV">#</a><code>PadnamePV</code> </dt>
<dd>

<p>NOTE: <code>PadnamePV</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The name stored in the pad name struct. This returns <code>NULL</code> for a target slot.</p>

<ul>

<pre><code class="plaintext">char *  PadnamePV(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnameREFCNT"><a class="permalink" href="perlapi.html#PadnameREFCNT">#</a><code>PadnameREFCNT</code> </dt>
<dd>

<p>NOTE: <code>PadnameREFCNT</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>The reference count of the pad name.</p>

<ul>

<pre><code class="plaintext">SSize_t  PadnameREFCNT(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnameREFCNT_dec"><a class="permalink" href="perlapi.html#PadnameREFCNT_dec">#</a><code>PadnameREFCNT_dec</code> </dt>
<dd>

<p>NOTE: <code>PadnameREFCNT_dec</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Lowers the reference count of the pad name.</p>

<ul>

<pre><code class="plaintext">void  PadnameREFCNT_dec(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnameSV"><a class="permalink" href="perlapi.html#PadnameSV">#</a><code>PadnameSV</code> </dt>
<dd>

<p>NOTE: <code>PadnameSV</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Returns the pad name as a mortal SV.</p>

<ul>

<pre><code class="plaintext">SV *  PadnameSV(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PadnameUTF8"><a class="permalink" href="perlapi.html#PadnameUTF8">#</a><code>PadnameUTF8</code> </dt>
<dd>

<p>NOTE: <code>PadnameUTF8</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Whether PadnamePV is in UTF-8. Currently, this is always true.</p>

<ul>

<pre><code class="plaintext">bool  PadnameUTF8(PADNAME * pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_new"><a class="permalink" href="perlapi.html#pad_new">#</a><code>pad_new</code> </dt>
<dd>

<p>Create a new padlist, updating the global variables for the currently-compiling padlist to point to the new padlist. The following flags can be OR&#39;ed together:</p>

<pre><code class="plaintext">padnew_CLONE	this pad is for a cloned CV
padnew_SAVE		save old globals on the save stack
padnew_SAVESUB	also save extra stuff for start of sub</code></pre>

<ul>

<pre><code class="plaintext">PADLIST*  pad_new(int flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_comppad"><a class="permalink" href="perlapi.html#PL_comppad">#</a><code>PL_comppad</code> </dt>
<dd>

<p>NOTE: <code>PL_comppad</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>During compilation, this points to the array containing the values part of the pad for the currently-compiling code. (At runtime a CV may have many such value arrays; at compile time just one is constructed.) At runtime, this points to the array containing the currently-relevant values for the pad for the currently-executing code.</p>

</dd>
</dl>

<dl>

<dt id="PL_comppad_name"><a class="permalink" href="perlapi.html#PL_comppad_name">#</a><code>PL_comppad_name</code> </dt>
<dd>

<p>NOTE: <code>PL_comppad_name</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>During compilation, this points to the array containing the names part of the pad for the currently-compiling code.</p>

</dd>
</dl>

<dl>

<dt id="PL_curpad"><a class="permalink" href="perlapi.html#PL_curpad">#</a><code>PL_curpad</code> </dt>
<dd>

<p>NOTE: <code>PL_curpad</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Points directly to the body of the <a href="perlapi.html#PL_comppad">&quot;PL_comppad&quot;</a> array. (I.e., this is <code>PadARRAY(PL_comppad)</code>.)</p>

</dd>
</dl>

<h1 id="Password-and-Group-access"><a class="permalink" href="perlapi.html#Password-and-Group-access">#</a><a id="Password"></a>Password and Group access</h1>

<dl>

<dt id="GRPASSWD"><a class="permalink" href="perlapi.html#GRPASSWD">#</a><code>GRPASSWD</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct group</code> in <i>grp.h</i> contains <code>gr_passwd</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ENDGRENT"><a class="permalink" href="perlapi.html#HAS_ENDGRENT">#</a><code>HAS_ENDGRENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the getgrent routine is available for finalizing sequential access of the group database.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ENDGRENT_R"><a class="permalink" href="perlapi.html#HAS_ENDGRENT_R">#</a><code>HAS_ENDGRENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>endgrent_r</code> routine is available to endgrent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ENDPWENT"><a class="permalink" href="perlapi.html#HAS_ENDPWENT">#</a><code>HAS_ENDPWENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the getgrent routine is available for finalizing sequential access of the passwd database.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ENDPWENT_R"><a class="permalink" href="perlapi.html#HAS_ENDPWENT_R">#</a><code>HAS_ENDPWENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>endpwent_r</code> routine is available to endpwent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETGRENT"><a class="permalink" href="perlapi.html#HAS_GETGRENT">#</a><code>HAS_GETGRENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getgrent</code> routine is available for sequential access of the group database.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETGRENT_R"><a class="permalink" href="perlapi.html#HAS_GETGRENT_R">#</a><code>HAS_GETGRENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getgrent_r</code> routine is available to getgrent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETPWENT"><a class="permalink" href="perlapi.html#HAS_GETPWENT">#</a><code>HAS_GETPWENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getpwent</code> routine is available for sequential access of the passwd database. If this is not available, the older <code>getpw()</code> function may be available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETPWENT_R"><a class="permalink" href="perlapi.html#HAS_GETPWENT_R">#</a><code>HAS_GETPWENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getpwent_r</code> routine is available to getpwent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETGRENT"><a class="permalink" href="perlapi.html#HAS_SETGRENT">#</a><code>HAS_SETGRENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setgrent</code> routine is available for initializing sequential access of the group database.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETGRENT_R"><a class="permalink" href="perlapi.html#HAS_SETGRENT_R">#</a><code>HAS_SETGRENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setgrent_r</code> routine is available to setgrent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETPWENT"><a class="permalink" href="perlapi.html#HAS_SETPWENT">#</a><code>HAS_SETPWENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setpwent</code> routine is available for initializing sequential access of the passwd database.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETPWENT_R"><a class="permalink" href="perlapi.html#HAS_SETPWENT_R">#</a><code>HAS_SETPWENT_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setpwent_r</code> routine is available to setpwent re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="PWAGE"><a class="permalink" href="perlapi.html#PWAGE">#</a><code>PWAGE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_age</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWCHANGE"><a class="permalink" href="perlapi.html#PWCHANGE">#</a><code>PWCHANGE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_change</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWCLASS"><a class="permalink" href="perlapi.html#PWCLASS">#</a><code>PWCLASS</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_class</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWCOMMENT"><a class="permalink" href="perlapi.html#PWCOMMENT">#</a><code>PWCOMMENT</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_comment</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWEXPIRE"><a class="permalink" href="perlapi.html#PWEXPIRE">#</a><code>PWEXPIRE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_expire</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWGECOS"><a class="permalink" href="perlapi.html#PWGECOS">#</a><code>PWGECOS</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_gecos</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWPASSWD"><a class="permalink" href="perlapi.html#PWPASSWD">#</a><code>PWPASSWD</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_passwd</code>.</p>

</dd>
</dl>

<dl>

<dt id="PWQUOTA"><a class="permalink" href="perlapi.html#PWQUOTA">#</a><code>PWQUOTA</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that <code>struct passwd</code> contains <code>pw_quota</code>.</p>

</dd>
</dl>

<h1 id="Paths-to-system-commands"><a class="permalink" href="perlapi.html#Paths-to-system-commands">#</a><a id="Paths"></a>Paths to system commands</h1>

<dl>

<dt id="CSH"><a class="permalink" href="perlapi.html#CSH">#</a><code>CSH</code> </dt>
<dd>

<p>This symbol, if defined, contains the full pathname of csh.</p>

</dd>
</dl>

<dl>

<dt id="LOC_SED"><a class="permalink" href="perlapi.html#LOC_SED">#</a><code>LOC_SED</code> </dt>
<dd>

<p>This symbol holds the complete pathname to the sed program.</p>

</dd>
</dl>

<dl>

<dt id="SH_PATH"><a class="permalink" href="perlapi.html#SH_PATH">#</a><code>SH_PATH</code> </dt>
<dd>

<p>This symbol contains the full pathname to the shell used on this on this system to execute Bourne shell scripts. Usually, this will be <i>/bin/sh</i>, though it&#39;s possible that some systems will have <i>/bin/ksh</i>, <i>/bin/pdksh</i>, <i>/bin/ash</i>, <i>/bin/bash</i>, or even something such as D:<i>/bin/sh.exe</i>.</p>

</dd>
</dl>

<h1 id="Prototype-information"><a class="permalink" href="perlapi.html#Prototype-information">#</a><a id="Prototype"></a>Prototype information</h1>

<dl>

<dt id="CRYPT_R_PROTO"><a class="permalink" href="perlapi.html#CRYPT_R_PROTO">#</a><code>CRYPT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>crypt_r</code>. It is zero if <code>d_crypt_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_crypt_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="CTERMID_R_PROTO"><a class="permalink" href="perlapi.html#CTERMID_R_PROTO">#</a><code>CTERMID_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>ctermid_r</code>. It is zero if <code>d_ctermid_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_ctermid_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="DRAND48_R_PROTO"><a class="permalink" href="perlapi.html#DRAND48_R_PROTO">#</a><code>DRAND48_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>drand48_r</code>. It is zero if <code>d_drand48_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_drand48_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDGRENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDGRENT_R_PROTO">#</a><code>ENDGRENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endgrent_r</code>. It is zero if <code>d_endgrent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endgrent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDHOSTENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDHOSTENT_R_PROTO">#</a><code>ENDHOSTENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endhostent_r</code>. It is zero if <code>d_endhostent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endhostent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDNETENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDNETENT_R_PROTO">#</a><code>ENDNETENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endnetent_r</code>. It is zero if <code>d_endnetent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endnetent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDPROTOENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDPROTOENT_R_PROTO">#</a><code>ENDPROTOENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endprotoent_r</code>. It is zero if <code>d_endprotoent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endprotoent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDPWENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDPWENT_R_PROTO">#</a><code>ENDPWENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endpwent_r</code>. It is zero if <code>d_endpwent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endpwent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="ENDSERVENT_R_PROTO"><a class="permalink" href="perlapi.html#ENDSERVENT_R_PROTO">#</a><code>ENDSERVENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>endservent_r</code>. It is zero if <code>d_endservent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_endservent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GDBMNDBM_H_USES_PROTOTYPES"><a class="permalink" href="perlapi.html#GDBMNDBM_H_USES_PROTOTYPES">#</a><code>GDBMNDBM_H_USES_PROTOTYPES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>gdbm/ndbm.h</i> uses real <code>ANSI</code> C prototypes instead of K&amp;R style function declarations without any parameter information. While <code>ANSI</code> C prototypes are supported in C++, K&amp;R style function declarations will yield errors.</p>

</dd>
</dl>

<dl>

<dt id="GDBM_NDBM_H_USES_PROTOTYPES"><a class="permalink" href="perlapi.html#GDBM_NDBM_H_USES_PROTOTYPES">#</a><code>GDBM_NDBM_H_USES_PROTOTYPES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that &lt;gdbm-<i>ndbm.h</i>&gt; uses real <code>ANSI</code> C prototypes instead of K&amp;R style function declarations without any parameter information. While <code>ANSI</code> C prototypes are supported in C++, K&amp;R style function declarations will yield errors.</p>

</dd>
</dl>

<dl>

<dt id="GETGRENT_R_PROTO"><a class="permalink" href="perlapi.html#GETGRENT_R_PROTO">#</a><code>GETGRENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getgrent_r</code>. It is zero if <code>d_getgrent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getgrent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETGRGID_R_PROTO"><a class="permalink" href="perlapi.html#GETGRGID_R_PROTO">#</a><code>GETGRGID_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getgrgid_r</code>. It is zero if <code>d_getgrgid_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getgrgid_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETGRNAM_R_PROTO"><a class="permalink" href="perlapi.html#GETGRNAM_R_PROTO">#</a><code>GETGRNAM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getgrnam_r</code>. It is zero if <code>d_getgrnam_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getgrnam_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETHOSTBYADDR_R_PROTO"><a class="permalink" href="perlapi.html#GETHOSTBYADDR_R_PROTO">#</a><code>GETHOSTBYADDR_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>gethostbyaddr_r</code>. It is zero if <code>d_gethostbyaddr_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_gethostbyaddr_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETHOSTBYNAME_R_PROTO"><a class="permalink" href="perlapi.html#GETHOSTBYNAME_R_PROTO">#</a><code>GETHOSTBYNAME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>gethostbyname_r</code>. It is zero if <code>d_gethostbyname_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_gethostbyname_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETHOSTENT_R_PROTO"><a class="permalink" href="perlapi.html#GETHOSTENT_R_PROTO">#</a><code>GETHOSTENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>gethostent_r</code>. It is zero if <code>d_gethostent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_gethostent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETLOGIN_R_PROTO"><a class="permalink" href="perlapi.html#GETLOGIN_R_PROTO">#</a><code>GETLOGIN_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getlogin_r</code>. It is zero if <code>d_getlogin_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getlogin_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETNETBYADDR_R_PROTO"><a class="permalink" href="perlapi.html#GETNETBYADDR_R_PROTO">#</a><code>GETNETBYADDR_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getnetbyaddr_r</code>. It is zero if <code>d_getnetbyaddr_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getnetbyaddr_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETNETBYNAME_R_PROTO"><a class="permalink" href="perlapi.html#GETNETBYNAME_R_PROTO">#</a><code>GETNETBYNAME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getnetbyname_r</code>. It is zero if <code>d_getnetbyname_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getnetbyname_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETNETENT_R_PROTO"><a class="permalink" href="perlapi.html#GETNETENT_R_PROTO">#</a><code>GETNETENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getnetent_r</code>. It is zero if <code>d_getnetent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getnetent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPROTOBYNAME_R_PROTO"><a class="permalink" href="perlapi.html#GETPROTOBYNAME_R_PROTO">#</a><code>GETPROTOBYNAME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getprotobyname_r</code>. It is zero if <code>d_getprotobyname_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getprotobyname_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPROTOBYNUMBER_R_PROTO"><a class="permalink" href="perlapi.html#GETPROTOBYNUMBER_R_PROTO">#</a><code>GETPROTOBYNUMBER_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getprotobynumber_r</code>. It is zero if <code>d_getprotobynumber_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getprotobynumber_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPROTOENT_R_PROTO"><a class="permalink" href="perlapi.html#GETPROTOENT_R_PROTO">#</a><code>GETPROTOENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getprotoent_r</code>. It is zero if <code>d_getprotoent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getprotoent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPWENT_R_PROTO"><a class="permalink" href="perlapi.html#GETPWENT_R_PROTO">#</a><code>GETPWENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getpwent_r</code>. It is zero if <code>d_getpwent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getpwent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPWNAM_R_PROTO"><a class="permalink" href="perlapi.html#GETPWNAM_R_PROTO">#</a><code>GETPWNAM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getpwnam_r</code>. It is zero if <code>d_getpwnam_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getpwnam_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETPWUID_R_PROTO"><a class="permalink" href="perlapi.html#GETPWUID_R_PROTO">#</a><code>GETPWUID_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getpwuid_r</code>. It is zero if <code>d_getpwuid_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getpwuid_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETSERVBYNAME_R_PROTO"><a class="permalink" href="perlapi.html#GETSERVBYNAME_R_PROTO">#</a><code>GETSERVBYNAME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getservbyname_r</code>. It is zero if <code>d_getservbyname_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getservbyname_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETSERVBYPORT_R_PROTO"><a class="permalink" href="perlapi.html#GETSERVBYPORT_R_PROTO">#</a><code>GETSERVBYPORT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getservbyport_r</code>. It is zero if <code>d_getservbyport_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getservbyport_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETSERVENT_R_PROTO"><a class="permalink" href="perlapi.html#GETSERVENT_R_PROTO">#</a><code>GETSERVENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getservent_r</code>. It is zero if <code>d_getservent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getservent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GETSPNAM_R_PROTO"><a class="permalink" href="perlapi.html#GETSPNAM_R_PROTO">#</a><code>GETSPNAM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>getspnam_r</code>. It is zero if <code>d_getspnam_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_getspnam_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DBMINIT_PROTO"><a class="permalink" href="perlapi.html#HAS_DBMINIT_PROTO">#</a><code>HAS_DBMINIT_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>dbminit()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern int dbminit(char *);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_DRAND48_PROTO"><a class="permalink" href="perlapi.html#HAS_DRAND48_PROTO">#</a><code>HAS_DRAND48_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>drand48()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern double drand48(void);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_FLOCK_PROTO"><a class="permalink" href="perlapi.html#HAS_FLOCK_PROTO">#</a><code>HAS_FLOCK_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>flock()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern int flock(int, int);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_GETHOST_PROTOS"><a class="permalink" href="perlapi.html#HAS_GETHOST_PROTOS">#</a><code>HAS_GETHOST_PROTOS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>netdb.h</i> includes prototypes for <code>gethostent()</code>, <code>gethostbyname()</code>, and <code>gethostbyaddr()</code>. Otherwise, it is up to the program to guess them. See netdbtype.U (part of metaconfig) for probing for various <code>Netdb_xxx_t</code> types.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETNET_PROTOS"><a class="permalink" href="perlapi.html#HAS_GETNET_PROTOS">#</a><code>HAS_GETNET_PROTOS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>netdb.h</i> includes prototypes for <code>getnetent()</code>, <code>getnetbyname()</code>, and <code>getnetbyaddr()</code>. Otherwise, it is up to the program to guess them. See netdbtype.U (part of metaconfig) for probing for various <code>Netdb_xxx_t</code> types.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETPROTO_PROTOS"><a class="permalink" href="perlapi.html#HAS_GETPROTO_PROTOS">#</a><code>HAS_GETPROTO_PROTOS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>netdb.h</i> includes prototypes for <code>getprotoent()</code>, <code>getprotobyname()</code>, and <code>getprotobyaddr()</code>. Otherwise, it is up to the program to guess them. See netdbtype.U (part of metaconfig) for probing for various <code>Netdb_xxx_t</code> types.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETSERV_PROTOS"><a class="permalink" href="perlapi.html#HAS_GETSERV_PROTOS">#</a><code>HAS_GETSERV_PROTOS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>netdb.h</i> includes prototypes for <code>getservent()</code>, <code>getservbyname()</code>, and <code>getservbyaddr()</code>. Otherwise, it is up to the program to guess them. See netdbtype.U (part of metaconfig) for probing for various <code>Netdb_xxx_t</code> types.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MODFL_PROTO"><a class="permalink" href="perlapi.html#HAS_MODFL_PROTO">#</a><code>HAS_MODFL_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>modfl()</code> function. Otherwise, it is up to the program to supply one.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SBRK_PROTO"><a class="permalink" href="perlapi.html#HAS_SBRK_PROTO">#</a><code>HAS_SBRK_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>sbrk()</code> function. Otherwise, it is up to the program to supply one. Good guesses are</p>

<pre><code>extern void* sbrk(int);
extern void* sbrk(size_t);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_SETRESGID_PROTO"><a class="permalink" href="perlapi.html#HAS_SETRESGID_PROTO">#</a><code>HAS_SETRESGID_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>setresgid()</code> function. Otherwise, it is up to the program to supply one. Good guesses are</p>

<pre><code>extern int setresgid(uid_t ruid, uid_t euid, uid_t suid);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_SETRESUID_PROTO"><a class="permalink" href="perlapi.html#HAS_SETRESUID_PROTO">#</a><code>HAS_SETRESUID_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>setresuid()</code> function. Otherwise, it is up to the program to supply one. Good guesses are</p>

<pre><code>extern int setresuid(uid_t ruid, uid_t euid, uid_t suid);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_SHMAT_PROTOTYPE"><a class="permalink" href="perlapi.html#HAS_SHMAT_PROTOTYPE">#</a><code>HAS_SHMAT_PROTOTYPE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <i>sys/shm.h</i> includes a prototype for <code>shmat()</code>. Otherwise, it is up to the program to guess one. <code>Shmat_t</code> <code>shmat(int, Shmat_t, int)</code> is a good guess, but not always right so it should be emitted by the program only when <code>HAS_SHMAT_PROTOTYPE</code> is not defined to avoid conflicting defs.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKATMARK_PROTO"><a class="permalink" href="perlapi.html#HAS_SOCKATMARK_PROTO">#</a><code>HAS_SOCKATMARK_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>sockatmark()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern int sockatmark(int);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_SYSCALL_PROTO"><a class="permalink" href="perlapi.html#HAS_SYSCALL_PROTO">#</a><code>HAS_SYSCALL_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>syscall()</code> function. Otherwise, it is up to the program to supply one. Good guesses are</p>

<pre><code>extern int syscall(int,  ...);
extern int syscall(long, ...);</code></pre>

</dd>
</dl>

<dl>

<dt id="HAS_TELLDIR_PROTO"><a class="permalink" href="perlapi.html#HAS_TELLDIR_PROTO">#</a><code>HAS_TELLDIR_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>telldir()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern long telldir(DIR*);</code></pre>

</dd>
</dl>

<dl>

<dt id="NDBM_H_USES_PROTOTYPES"><a class="permalink" href="perlapi.html#NDBM_H_USES_PROTOTYPES">#</a><code>NDBM_H_USES_PROTOTYPES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>ndbm.h</i> uses real <code>ANSI</code> C prototypes instead of K&amp;R style function declarations without any parameter information. While <code>ANSI</code> C prototypes are supported in C++, K&amp;R style function declarations will yield errors.</p>

</dd>
</dl>

<dl>

<dt id="RANDOM_R_PROTO"><a class="permalink" href="perlapi.html#RANDOM_R_PROTO">#</a><code>RANDOM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>random_r</code>. It is zero if <code>d_random_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_random_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="READDIR_R_PROTO"><a class="permalink" href="perlapi.html#READDIR_R_PROTO">#</a><code>READDIR_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>readdir_r</code>. It is zero if <code>d_readdir_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_readdir_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETGRENT_R_PROTO"><a class="permalink" href="perlapi.html#SETGRENT_R_PROTO">#</a><code>SETGRENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setgrent_r</code>. It is zero if <code>d_setgrent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setgrent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETHOSTENT_R_PROTO"><a class="permalink" href="perlapi.html#SETHOSTENT_R_PROTO">#</a><code>SETHOSTENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>sethostent_r</code>. It is zero if <code>d_sethostent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_sethostent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETLOCALE_R_PROTO"><a class="permalink" href="perlapi.html#SETLOCALE_R_PROTO">#</a><code>SETLOCALE_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setlocale_r</code>. It is zero if <code>d_setlocale_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setlocale_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETNETENT_R_PROTO"><a class="permalink" href="perlapi.html#SETNETENT_R_PROTO">#</a><code>SETNETENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setnetent_r</code>. It is zero if <code>d_setnetent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setnetent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETPROTOENT_R_PROTO"><a class="permalink" href="perlapi.html#SETPROTOENT_R_PROTO">#</a><code>SETPROTOENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setprotoent_r</code>. It is zero if <code>d_setprotoent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setprotoent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETPWENT_R_PROTO"><a class="permalink" href="perlapi.html#SETPWENT_R_PROTO">#</a><code>SETPWENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setpwent_r</code>. It is zero if <code>d_setpwent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setpwent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SETSERVENT_R_PROTO"><a class="permalink" href="perlapi.html#SETSERVENT_R_PROTO">#</a><code>SETSERVENT_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>setservent_r</code>. It is zero if <code>d_setservent_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_setservent_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SRAND48_R_PROTO"><a class="permalink" href="perlapi.html#SRAND48_R_PROTO">#</a><code>SRAND48_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>srand48_r</code>. It is zero if <code>d_srand48_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_srand48_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="SRANDOM_R_PROTO"><a class="permalink" href="perlapi.html#SRANDOM_R_PROTO">#</a><code>SRANDOM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>srandom_r</code>. It is zero if <code>d_srandom_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_srandom_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="STRERROR_R_PROTO"><a class="permalink" href="perlapi.html#STRERROR_R_PROTO">#</a><code>STRERROR_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>strerror_r</code>. It is zero if <code>d_strerror_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_strerror_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="TMPNAM_R_PROTO"><a class="permalink" href="perlapi.html#TMPNAM_R_PROTO">#</a><code>TMPNAM_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>tmpnam_r</code>. It is zero if <code>d_tmpnam_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_tmpnam_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="TTYNAME_R_PROTO"><a class="permalink" href="perlapi.html#TTYNAME_R_PROTO">#</a><code>TTYNAME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>ttyname_r</code>. It is zero if <code>d_ttyname_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_ttyname_r</code> is defined.</p>

</dd>
</dl>

<h1 id="REGEXP-Functions"><a class="permalink" href="perlapi.html#REGEXP-Functions">#</a><a id="REGEXP"></a>REGEXP Functions</h1>

<dl>

<dt id="pregcomp"><a class="permalink" href="perlapi.html#pregcomp">#</a><code>pregcomp</code></dt>
<dd>

<p>Described in <a href="perlreguts.html">perlreguts</a>.</p>

<ul>

<pre><code class="plaintext">REGEXP*  pregcomp(SV * const pattern, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pregexec"><a class="permalink" href="perlapi.html#pregexec">#</a><code>pregexec</code></dt>
<dd>

<p>Described in <a href="perlreguts.html">perlreguts</a>.</p>

<ul>

<pre><code class="plaintext">I32  pregexec(REGEXP * const prog, char* stringarg, char* strend,
              char* strbeg, SSize_t minend, SV* screamer,
              U32 nosave)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="re_dup_guts"><a class="permalink" href="perlapi.html#re_dup_guts">#</a><code>re_dup_guts</code> </dt>
<dd>

<p>Duplicate a regexp.</p>

<p>This routine is expected to clone a given regexp structure. It is only compiled under USE_ITHREADS.</p>

<p>After all of the core data stored in struct regexp is duplicated the <code>regexp_engine.dupe</code> method is used to copy any private data stored in the *pprivate pointer. This allows extensions to handle any duplication they need to do.</p>

<ul>

<pre><code class="plaintext">void  re_dup_guts(const REGEXP *sstr, REGEXP *dstr,
                  CLONE_PARAMS* param)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="regmatch_info"><a class="permalink" href="perlapi.html#regmatch_info">#</a><code>regmatch_info</code> </dt>
<dd>

<p>Some basic information about the current match that is created by Perl_regexec_flags and then passed to regtry(), regmatch() etc. It is allocated as a local var on the stack, so nothing should be stored in it that needs preserving or clearing up on croak(). For that, see the aux_info and aux_info_eval members of the regmatch_state union.</p>

</dd>
</dl>

<dl>

<dt id="SvRX"><a class="permalink" href="perlapi.html#SvRX">#</a><code>SvRX</code> </dt>
<dd>

<p>Convenience macro to get the REGEXP from a SV. This is approximately equivalent to the following snippet:</p>

<pre><code>if (SvMAGICAL(sv))
    mg_get(sv);
if (SvROK(sv))
    sv = MUTABLE_SV(SvRV(sv));
if (SvTYPE(sv) == SVt_REGEXP)
    return (REGEXP*) sv;</code></pre>

<p><code>NULL</code> will be returned if a REGEXP* is not found.</p>

<ul>

<pre><code class="plaintext">REGEXP *  SvRX(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvRXOK"><a class="permalink" href="perlapi.html#SvRXOK">#</a><code>SvRXOK</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV (or the one it references) is a REGEXP.</p>

<p>If you want to do something with the REGEXP* later use SvRX instead and check for NULL.</p>

<ul>

<pre><code class="plaintext">bool  SvRXOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Signals"><a class="permalink" href="perlapi.html#Signals">#</a>Signals</h1>

<dl>

<dt id="HAS_SIGINFO_SI_ADDR"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_ADDR">#</a><code>HAS_SIGINFO_SI_ADDR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_addr</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_BAND"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_BAND">#</a><code>HAS_SIGINFO_SI_BAND</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_band</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_ERRNO"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_ERRNO">#</a><code>HAS_SIGINFO_SI_ERRNO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_errno</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_PID"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_PID">#</a><code>HAS_SIGINFO_SI_PID</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_pid</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_STATUS"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_STATUS">#</a><code>HAS_SIGINFO_SI_STATUS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_status</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_UID"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_UID">#</a><code>HAS_SIGINFO_SI_UID</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_uid</code> member</p>

</dd>
</dl>

<dl>

<dt id="HAS_SIGINFO_SI_VALUE"><a class="permalink" href="perlapi.html#HAS_SIGINFO_SI_VALUE">#</a><code>HAS_SIGINFO_SI_VALUE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>siginfo_t</code> has the <code>si_value</code> member</p>

</dd>
</dl>

<dl>

<dt id="PERL_SIGNALS_UNSAFE_FLAG"><a class="permalink" href="perlapi.html#PERL_SIGNALS_UNSAFE_FLAG">#</a><code>PERL_SIGNALS_UNSAFE_FLAG</code> </dt>
<dd>

<p>If this bit in <code>PL_signals</code> is set, the system is uing the pre-Perl 5.8 unsafe signals. See <a href="perlrun.html#PERL_SIGNALS">&quot;PERL_SIGNALS&quot; in perlrun</a> and <a href="perlipc.html#Deferred-Signals-%28Safe-Signals%29">&quot;Deferred Signals (Safe Signals)&quot; in perlipc</a>.</p>

<ul>

<pre><code class="plaintext">U32  PERL_SIGNALS_UNSAFE_FLAG</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="rsignal"><a class="permalink" href="perlapi.html#rsignal">#</a><code>rsignal</code> </dt>
<dd>

<p>A wrapper for the C library <a href="http://man.he.net/man2/signal">signal(2)</a>. Don&#39;t use the latter, as the Perl version knows things that interact with the rest of the perl interpreter.</p>

<ul>

<pre><code class="plaintext">Sighandler_t  rsignal(int i, Sighandler_t t)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Sigjmp_buf"><a class="permalink" href="perlapi.html#Sigjmp_buf">#</a><code>Sigjmp_buf</code> </dt>
<dd>

<p>This is the buffer type to be used with Sigsetjmp and Siglongjmp.</p>

</dd>
</dl>

<dl>

<dt id="Siglongjmp"><a class="permalink" href="perlapi.html#Siglongjmp">#</a><code>Siglongjmp</code> </dt>
<dd>

<p>This macro is used in the same way as <code>siglongjmp()</code>, but will invoke traditional <code>longjmp()</code> if siglongjmp isn&#39;t available. See <code><a href="perlapi.html#HAS_SIGSETJMP">&quot;HAS_SIGSETJMP&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  Siglongjmp(jmp_buf env, int val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SIG_NAME"><a class="permalink" href="perlapi.html#SIG_NAME">#</a><code>SIG_NAME</code> </dt>
<dd>

<p>This symbol contains a list of signal names in order of signal number. This is intended to be used as a static array initialization, like this:</p>

<pre><code>char *sig_name[] = { SIG_NAME };</code></pre>

<p>The signals in the list are separated with commas, and each signal is surrounded by double quotes. There is no leading <code>SIG</code> in the signal name, i.e. <code>SIGQUIT</code> is known as &quot;<code>QUIT</code>&quot;. Gaps in the signal numbers (up to <code>NSIG</code>) are filled in with <code>NUMnn</code>, etc., where nn is the actual signal number (e.g. <code>NUM37</code>). The signal number for <code>sig_name[i]</code> is stored in <code>sig_num[i]</code>. The last element is 0 to terminate the list with a <code>NULL</code>. This corresponds to the 0 at the end of the <code>sig_name_init</code> list. Note that this variable is initialized from the <code>sig_name_init</code>, not from <code>sig_name</code> (which is unused).</p>

</dd>
</dl>

<dl>

<dt id="SIG_NUM"><a class="permalink" href="perlapi.html#SIG_NUM">#</a><code>SIG_NUM</code> </dt>
<dd>

<p>This symbol contains a list of signal numbers, in the same order as the <code>SIG_NAME</code> list. It is suitable for static array initialization, as in:</p>

<pre><code>int sig_num[] = { SIG_NUM };</code></pre>

<p>The signals in the list are separated with commas, and the indices within that list and the <code>SIG_NAME</code> list match, so it&#39;s easy to compute the signal name from a number or vice versa at the price of a small dynamic linear lookup. Duplicates are allowed, but are moved to the end of the list. The signal number corresponding to <code>sig_name[i]</code> is <code>sig_number[i]</code>. if (i &lt; <code>NSIG</code>) then <code>sig_number[i]</code> == i. The last element is 0, corresponding to the 0 at the end of the <code>sig_name_init</code> list. Note that this variable is initialized from the <code>sig_num_init</code>, not from <code>sig_num</code> (which is unused).</p>

</dd>
</dl>

<dl>

<dt id="Sigsetjmp"><a class="permalink" href="perlapi.html#Sigsetjmp">#</a><code>Sigsetjmp</code> </dt>
<dd>

<p>This macro is used in the same way as <code>sigsetjmp()</code>, but will invoke traditional <code>setjmp()</code> if sigsetjmp isn&#39;t available. See <code><a href="perlapi.html#HAS_SIGSETJMP">&quot;HAS_SIGSETJMP&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">int  Sigsetjmp(jmp_buf env, int savesigs)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SIG_SIZE"><a class="permalink" href="perlapi.html#SIG_SIZE">#</a><code>SIG_SIZE</code> </dt>
<dd>

<p>This variable contains the number of elements of the <code>SIG_NAME</code> and <code>SIG_NUM</code> arrays, excluding the final <code>NULL</code> entry.</p>

</dd>
</dl>

<dl>

<dt id="whichsig"><a class="permalink" href="perlapi.html#whichsig">#</a><code>whichsig</code></dt>
<dd>

</dd>
<dt id="whichsig_pv"><a class="permalink" href="perlapi.html#whichsig_pv">#</a><code>whichsig_pv</code></dt>
<dd>

</dd>
<dt id="whichsig_pvn"><a class="permalink" href="perlapi.html#whichsig_pvn">#</a><code>whichsig_pvn</code></dt>
<dd>

</dd>
<dt id="whichsig_sv"><a class="permalink" href="perlapi.html#whichsig_sv">#</a><code>whichsig_sv</code> </dt>
<dd>

<p>These all convert a signal name into its corresponding signal number; returning -1 if no corresponding number was found.</p>

<p>They differ only in the source of the signal name:</p>

<p><code>whichsig_pv</code> takes the name from the <code>NUL</code>-terminated string starting at <code>sig</code>.</p>

<p><code>whichsig</code> is merely a different spelling, a synonym, of <code>whichsig_pv</code>.</p>

<p><code>whichsig_pvn</code> takes the name from the string starting at <code>sig</code>, with length <code>len</code> bytes.</p>

<p><code>whichsig_sv</code> takes the name from the PV stored in the SV <code>sigsv</code>.</p>

<ul>

<pre><code class="plaintext">I32  whichsig    (const char* sig)
I32  whichsig_pv (const char* sig)
I32  whichsig_pvn(const char* sig, STRLEN len)
I32  whichsig_sv (SV* sigsv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Site-configuration"><a class="permalink" href="perlapi.html#Site-configuration">#</a><a id="Site"></a>Site configuration</h1>

<p>These variables give details as to where various libraries, installation destinations, <i>etc.</i>, go, as well as what various installation options were selected</p>

<dl>

<dt id="ARCHLIB"><a class="permalink" href="perlapi.html#ARCHLIB">#</a><code>ARCHLIB</code> </dt>
<dd>

<p>This variable, if defined, holds the name of the directory in which the user wants to put architecture-dependent public library files for perl5. It is most often a local directory such as <i>/usr/local/lib</i>. Programs using this variable must be prepared to deal with filename expansion. If <code>ARCHLIB</code> is the same as <code>PRIVLIB</code>, it is not defined, since presumably the program already searches <code>PRIVLIB</code>.</p>

</dd>
</dl>

<dl>

<dt id="ARCHLIB_EXP"><a class="permalink" href="perlapi.html#ARCHLIB_EXP">#</a><code>ARCHLIB_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>ARCHLIB</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="ARCHNAME"><a class="permalink" href="perlapi.html#ARCHNAME">#</a><code>ARCHNAME</code> </dt>
<dd>

<p>This symbol holds a string representing the architecture name. It may be used to construct an architecture-dependant pathname where library files may be held under a private library, for instance.</p>

</dd>
</dl>

<dl>

<dt id="BIN"><a class="permalink" href="perlapi.html#BIN">#</a><code>BIN</code> </dt>
<dd>

<p>This symbol holds the path of the bin directory where the package will be installed. Program must be prepared to deal with ~name substitution.</p>

</dd>
</dl>

<dl>

<dt id="BIN_EXP"><a class="permalink" href="perlapi.html#BIN_EXP">#</a><code>BIN_EXP</code> </dt>
<dd>

<p>This symbol is the filename expanded version of the <code>BIN</code> symbol, for programs that do not want to deal with that at run-time.</p>

</dd>
</dl>

<dl>

<dt id="INSTALL_USR_BIN_PERL"><a class="permalink" href="perlapi.html#INSTALL_USR_BIN_PERL">#</a><code>INSTALL_USR_BIN_PERL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl is to be installed also as <i>/usr/bin/perl</i>.</p>

</dd>
</dl>

<dl>

<dt id="MULTIARCH"><a class="permalink" href="perlapi.html#MULTIARCH">#</a><code>MULTIARCH</code> </dt>
<dd>

<p>This symbol, if defined, signifies that the build process will produce some binary files that are going to be used in a cross-platform environment. This is the case for example with the NeXT &quot;fat&quot; binaries that contain executables for several <code>CPUs</code>.</p>

</dd>
</dl>

<dl>

<dt id="PERL_INC_VERSION_LIST"><a class="permalink" href="perlapi.html#PERL_INC_VERSION_LIST">#</a><code>PERL_INC_VERSION_LIST</code> </dt>
<dd>

<p>This variable specifies the list of subdirectories in over which <i>perl.c</i>:<code>incpush()</code> and <i>lib/lib.pm</i> will automatically search when adding directories to @<code>INC</code>, in a format suitable for a C initialization string. See the <code>inc_version_list</code> entry in Porting/Glossary for more details.</p>

</dd>
</dl>

<dl>

<dt id="PERL_OTHERLIBDIRS"><a class="permalink" href="perlapi.html#PERL_OTHERLIBDIRS">#</a><code>PERL_OTHERLIBDIRS</code> </dt>
<dd>

<p>This variable contains a colon-separated set of paths for the perl binary to search for additional library files or modules. These directories will be tacked to the end of @<code>INC</code>. Perl will automatically search below each path for version- and architecture-specific directories. See <code><a href="perlapi.html#PERL_INC_VERSION_LIST">&quot;PERL_INC_VERSION_LIST&quot;</a></code> for more details.</p>

</dd>
</dl>

<dl>

<dt id="PERL_RELOCATABLE_INC"><a class="permalink" href="perlapi.html#PERL_RELOCATABLE_INC">#</a><code>PERL_RELOCATABLE_INC</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we&#39;d like to relocate entries in @<code>INC</code> at run time based on the location of the perl binary.</p>

</dd>
</dl>

<dl>

<dt id="PERL_TARGETARCH"><a class="permalink" href="perlapi.html#PERL_TARGETARCH">#</a><code>PERL_TARGETARCH</code> </dt>
<dd>

<p>This symbol, if defined, indicates the target architecture Perl has been cross-compiled to. Undefined if not a cross-compile.</p>

</dd>
</dl>

<dl>

<dt id="PERL_USE_DEVEL"><a class="permalink" href="perlapi.html#PERL_USE_DEVEL">#</a><code>PERL_USE_DEVEL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl was configured with <code>-Dusedevel</code>, to enable development features. This should not be done for production builds.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VENDORARCH"><a class="permalink" href="perlapi.html#PERL_VENDORARCH">#</a><code>PERL_VENDORARCH</code> </dt>
<dd>

<p>If defined, this symbol contains the name of a private library. The library is private in the sense that it needn&#39;t be in anyone&#39;s execution path, but it should be accessible by the world. It may have a ~ on the front. The standard distribution will put nothing in this directory. Vendors who distribute perl may wish to place their own architecture-dependent modules and extensions in this directory with</p>

<pre><code class="plaintext">MakeMaker Makefile.PL INSTALLDIRS=vendor</code></pre>

<p>or equivalent. See <code><a href="INSTALL.html">INSTALL</a></code> for details.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VENDORARCH_EXP"><a class="permalink" href="perlapi.html#PERL_VENDORARCH_EXP">#</a><code>PERL_VENDORARCH_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>PERL_VENDORARCH</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VENDORLIB_EXP"><a class="permalink" href="perlapi.html#PERL_VENDORLIB_EXP">#</a><code>PERL_VENDORLIB_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>VENDORLIB</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VENDORLIB_STEM"><a class="permalink" href="perlapi.html#PERL_VENDORLIB_STEM">#</a><code>PERL_VENDORLIB_STEM</code> </dt>
<dd>

<p>This define is <code>PERL_VENDORLIB_EXP</code> with any trailing version-specific component removed. The elements in <code>inc_version_list</code> (<code>inc_version_list</code>.U (part of metaconfig)) can be tacked onto this variable to generate a list of directories to search.</p>

</dd>
</dl>

<dl>

<dt id="PRIVLIB"><a class="permalink" href="perlapi.html#PRIVLIB">#</a><code>PRIVLIB</code> </dt>
<dd>

<p>This symbol contains the name of the private library for this package. The library is private in the sense that it needn&#39;t be in anyone&#39;s execution path, but it should be accessible by the world. The program should be prepared to do ~ expansion.</p>

</dd>
</dl>

<dl>

<dt id="PRIVLIB_EXP"><a class="permalink" href="perlapi.html#PRIVLIB_EXP">#</a><code>PRIVLIB_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>PRIVLIB</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="SITEARCH"><a class="permalink" href="perlapi.html#SITEARCH">#</a><code>SITEARCH</code> </dt>
<dd>

<p>This symbol contains the name of the private library for this package. The library is private in the sense that it needn&#39;t be in anyone&#39;s execution path, but it should be accessible by the world. The program should be prepared to do ~ expansion. The standard distribution will put nothing in this directory. After perl has been installed, users may install their own local architecture-dependent modules in this directory with</p>

<pre><code class="plaintext">MakeMaker Makefile.PL</code></pre>

<p>or equivalent. See <code><a href="INSTALL.html">INSTALL</a></code> for details.</p>

</dd>
</dl>

<dl>

<dt id="SITEARCH_EXP"><a class="permalink" href="perlapi.html#SITEARCH_EXP">#</a><code>SITEARCH_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>SITEARCH</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="SITELIB"><a class="permalink" href="perlapi.html#SITELIB">#</a><code>SITELIB</code> </dt>
<dd>

<p>This symbol contains the name of the private library for this package. The library is private in the sense that it needn&#39;t be in anyone&#39;s execution path, but it should be accessible by the world. The program should be prepared to do ~ expansion. The standard distribution will put nothing in this directory. After perl has been installed, users may install their own local architecture-independent modules in this directory with</p>

<pre><code class="plaintext">MakeMaker Makefile.PL</code></pre>

<p>or equivalent. See <code><a href="INSTALL.html">INSTALL</a></code> for details.</p>

</dd>
</dl>

<dl>

<dt id="SITELIB_EXP"><a class="permalink" href="perlapi.html#SITELIB_EXP">#</a><code>SITELIB_EXP</code> </dt>
<dd>

<p>This symbol contains the ~name expanded version of <code>SITELIB</code>, to be used in programs that are not prepared to deal with ~ expansion at run-time.</p>

</dd>
</dl>

<dl>

<dt id="SITELIB_STEM"><a class="permalink" href="perlapi.html#SITELIB_STEM">#</a><code>SITELIB_STEM</code> </dt>
<dd>

<p>This define is <code>SITELIB_EXP</code> with any trailing version-specific component removed. The elements in <code>inc_version_list</code> (<code>inc_version_list</code>.U (part of metaconfig)) can be tacked onto this variable to generate a list of directories to search.</p>

</dd>
</dl>

<dl>

<dt id="STARTPERL"><a class="permalink" href="perlapi.html#STARTPERL">#</a><code>STARTPERL</code> </dt>
<dd>

<p>This variable contains the string to put in front of a perl script to make sure (one hopes) that it runs with perl and not some shell.</p>

</dd>
</dl>

<dl>

<dt id="USE_64_BIT_ALL"><a class="permalink" href="perlapi.html#USE_64_BIT_ALL">#</a><code>USE_64_BIT_ALL</code> </dt>
<dd>

<p>This symbol, if defined, indicates that 64-bit integers should be used when available. If not defined, the native integers will be used (be they 32 or 64 bits). The maximal possible 64-bitness is employed: LP64 or <code>ILP64</code>, meaning that you will be able to use more than 2 gigabytes of memory. This mode is even more binary incompatible than <code>USE_64_BIT_INT</code>. You may not be able to run the resulting executable in a 32-bit <code>CPU</code> at all or you may need at least to reboot your OS to 64-bit mode.</p>

</dd>
</dl>

<dl>

<dt id="USE_64_BIT_INT"><a class="permalink" href="perlapi.html#USE_64_BIT_INT">#</a><code>USE_64_BIT_INT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that 64-bit integers should be used when available. If not defined, the native integers will be employed (be they 32 or 64 bits). The minimal possible 64-bitness is used, just enough to get 64-bit integers into Perl. This may mean using for example &quot;long longs&quot;, while your memory may still be limited to 2 gigabytes.</p>

</dd>
</dl>

<dl>

<dt id="USE_BSD_GETPGRP"><a class="permalink" href="perlapi.html#USE_BSD_GETPGRP">#</a><code>USE_BSD_GETPGRP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that getpgrp needs one arguments whereas <code>USG</code> one needs none.</p>

</dd>
</dl>

<dl>

<dt id="USE_BSD_SETPGRP"><a class="permalink" href="perlapi.html#USE_BSD_SETPGRP">#</a><code>USE_BSD_SETPGRP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that setpgrp needs two arguments whereas <code>USG</code> one needs none. See also <code><a href="perlapi.html#HAS_SETPGID">&quot;HAS_SETPGID&quot;</a></code> for a <code>POSIX</code> interface.</p>

</dd>
</dl>

<dl>

<dt id="USE_CPLUSPLUS"><a class="permalink" href="perlapi.html#USE_CPLUSPLUS">#</a><code>USE_CPLUSPLUS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that a C++ compiler was used to compiled Perl and will be used to compile extensions.</p>

</dd>
</dl>

<dl>

<dt id="USE_CROSS_COMPILE"><a class="permalink" href="perlapi.html#USE_CROSS_COMPILE">#</a><code>USE_CROSS_COMPILE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl is being cross-compiled.</p>

</dd>
</dl>

<dl>

<dt id="USE_C_BACKTRACE"><a class="permalink" href="perlapi.html#USE_C_BACKTRACE">#</a><code>USE_C_BACKTRACE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built with support for backtrace.</p>

</dd>
</dl>

<dl>

<dt id="USE_DTRACE"><a class="permalink" href="perlapi.html#USE_DTRACE">#</a><code>USE_DTRACE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built with support for DTrace.</p>

</dd>
</dl>

<dl>

<dt id="USE_DYNAMIC_LOADING"><a class="permalink" href="perlapi.html#USE_DYNAMIC_LOADING">#</a><code>USE_DYNAMIC_LOADING</code> </dt>
<dd>

<p>This symbol, if defined, indicates that dynamic loading of some sort is available.</p>

</dd>
</dl>

<dl>

<dt id="USE_FAST_STDIO"><a class="permalink" href="perlapi.html#USE_FAST_STDIO">#</a><code>USE_FAST_STDIO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use &#39;fast stdio&#39;. Defaults to define in Perls 5.8 and earlier, to undef later.</p>

</dd>
</dl>

<dl>

<dt id="USE_ITHREADS"><a class="permalink" href="perlapi.html#USE_ITHREADS">#</a><code>USE_ITHREADS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use the interpreter-based threading implementation.</p>

</dd>
</dl>

<dl>

<dt id="USE_KERN_PROC_PATHNAME"><a class="permalink" href="perlapi.html#USE_KERN_PROC_PATHNAME">#</a><code>USE_KERN_PROC_PATHNAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we can use sysctl with <code>KERN_PROC_PATHNAME</code> to get a full path for the executable, and hence convert $^X to an absolute path.</p>

</dd>
</dl>

<dl>

<dt id="USE_LARGE_FILES"><a class="permalink" href="perlapi.html#USE_LARGE_FILES">#</a><code>USE_LARGE_FILES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that large file support should be used when available.</p>

</dd>
</dl>

<dl>

<dt id="USE_LONG_DOUBLE"><a class="permalink" href="perlapi.html#USE_LONG_DOUBLE">#</a><code>USE_LONG_DOUBLE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that long doubles should be used when available.</p>

</dd>
</dl>

<dl>

<dt id="USE_MORE_BITS"><a class="permalink" href="perlapi.html#USE_MORE_BITS">#</a><code>USE_MORE_BITS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that 64-bit interfaces and long doubles should be used when available.</p>

</dd>
</dl>

<dl>

<dt id="USE_NSGETEXECUTABLEPATH"><a class="permalink" href="perlapi.html#USE_NSGETEXECUTABLEPATH">#</a><code>USE_NSGETEXECUTABLEPATH</code> </dt>
<dd>

<p>This symbol, if defined, indicates that we can use <code>_NSGetExecutablePath</code> and realpath to get a full path for the executable, and hence convert $^X to an absolute path.</p>

</dd>
</dl>

<dl>

<dt id="USE_PERLIO"><a class="permalink" href="perlapi.html#USE_PERLIO">#</a><code>USE_PERLIO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the PerlIO abstraction should be used throughout. If not defined, stdio should be used in a fully backward compatible manner.</p>

</dd>
</dl>

<dl>

<dt id="USE_QUADMATH"><a class="permalink" href="perlapi.html#USE_QUADMATH">#</a><code>USE_QUADMATH</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the quadmath library should be used when available.</p>

</dd>
</dl>

<dl>

<dt id="USE_REENTRANT_API"><a class="permalink" href="perlapi.html#USE_REENTRANT_API">#</a><code>USE_REENTRANT_API</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should try to use the various <code>_r</code> versions of library functions. This is extremely experimental.</p>

</dd>
</dl>

<dl>

<dt id="USE_SEMCTL_SEMID_DS"><a class="permalink" href="perlapi.html#USE_SEMCTL_SEMID_DS">#</a><code>USE_SEMCTL_SEMID_DS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>struct semid_ds</code> * is used for semctl <code>IPC_STAT</code>.</p>

</dd>
</dl>

<dl>

<dt id="USE_SEMCTL_SEMUN"><a class="permalink" href="perlapi.html#USE_SEMCTL_SEMUN">#</a><code>USE_SEMCTL_SEMUN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <code>union semun</code> is used for semctl <code>IPC_STAT</code>.</p>

</dd>
</dl>

<dl>

<dt id="USE_SITECUSTOMIZE"><a class="permalink" href="perlapi.html#USE_SITECUSTOMIZE">#</a><code>USE_SITECUSTOMIZE</code> </dt>
<dd>

<p>This symbol, if defined, indicates that sitecustomize should be used.</p>

</dd>
</dl>

<dl>

<dt id="USE_SOCKS"><a class="permalink" href="perlapi.html#USE_SOCKS">#</a><code>USE_SOCKS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use socks.</p>

</dd>
</dl>

<dl>

<dt id="USE_STAT_BLOCKS"><a class="permalink" href="perlapi.html#USE_STAT_BLOCKS">#</a><code>USE_STAT_BLOCKS</code> </dt>
<dd>

<p>This symbol is defined if this system has a stat structure declaring <code>st_blksize</code> and <code>st_blocks</code>.</p>

</dd>
</dl>

<dl>

<dt id="USE_STDIO_BASE"><a class="permalink" href="perlapi.html#USE_STDIO_BASE">#</a><code>USE_STDIO_BASE</code> </dt>
<dd>

<p>This symbol is defined if the <code>_base</code> field (or similar) of the stdio <code>FILE</code> structure can be used to access the stdio buffer for a file handle. If this is defined, then the <code>FILE_base(fp)</code> macro will also be defined and should be used to access this field. Also, the <code>FILE_bufsiz(fp)</code> macro will be defined and should be used to determine the number of bytes in the buffer. <code>USE_STDIO_BASE</code> will never be defined unless <code>USE_STDIO_PTR</code> is.</p>

</dd>
</dl>

<dl>

<dt id="USE_STDIO_PTR"><a class="permalink" href="perlapi.html#USE_STDIO_PTR">#</a><code>USE_STDIO_PTR</code> </dt>
<dd>

<p>This symbol is defined if the <code>_ptr</code> and <code>_cnt</code> fields (or similar) of the stdio <code>FILE</code> structure can be used to access the stdio buffer for a file handle. If this is defined, then the <code>FILE_ptr(fp)</code> and <code>FILE_cnt(fp)</code> macros will also be defined and should be used to access these fields.</p>

</dd>
</dl>

<dl>

<dt id="USE_STRICT_BY_DEFAULT"><a class="permalink" href="perlapi.html#USE_STRICT_BY_DEFAULT">#</a><code>USE_STRICT_BY_DEFAULT</code> </dt>
<dd>

<p>This symbol, if defined, enables additional defaults. At this time it only enables implicit strict by default.</p>

</dd>
</dl>

<dl>

<dt id="USE_THREADS"><a class="permalink" href="perlapi.html#USE_THREADS">#</a><code>USE_THREADS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that Perl should be built to use threads. At present, it is a synonym for and <code>USE_ITHREADS</code>, but eventually the source ought to be changed to use this to mean <code>_any_</code> threading implementation.</p>

</dd>
</dl>

<h1 id="Sockets-configuration-values"><a class="permalink" href="perlapi.html#Sockets-configuration-values">#</a><a id="Sockets"></a>Sockets configuration values</h1>

<dl>

<dt id="HAS_SOCKADDR_IN6"><a class="permalink" href="perlapi.html#HAS_SOCKADDR_IN6">#</a><code>HAS_SOCKADDR_IN6</code> </dt>
<dd>

<p>This symbol, if defined, indicates the availability of <code>struct sockaddr_in6</code>;</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKADDR_SA_LEN"><a class="permalink" href="perlapi.html#HAS_SOCKADDR_SA_LEN">#</a><code>HAS_SOCKADDR_SA_LEN</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>struct sockaddr</code> structure has a member called <code>sa_len</code>, indicating the length of the structure.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKADDR_STORAGE"><a class="permalink" href="perlapi.html#HAS_SOCKADDR_STORAGE">#</a><code>HAS_SOCKADDR_STORAGE</code> </dt>
<dd>

<p>This symbol, if defined, indicates the availability of <code>struct sockaddr_storage</code>;</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKATMARK"><a class="permalink" href="perlapi.html#HAS_SOCKATMARK">#</a><code>HAS_SOCKATMARK</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>sockatmark</code> routine is available to test whether a socket is at the out-of-band mark.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKET"><a class="permalink" href="perlapi.html#HAS_SOCKET">#</a><code>HAS_SOCKET</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>BSD</code> <code>socket</code> interface is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKETPAIR"><a class="permalink" href="perlapi.html#HAS_SOCKETPAIR">#</a><code>HAS_SOCKETPAIR</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>BSD</code> <code>socketpair()</code> call is supported.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SOCKS5_INIT"><a class="permalink" href="perlapi.html#HAS_SOCKS5_INIT">#</a><code>HAS_SOCKS5_INIT</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>socks5_init</code> routine is available to initialize <code>SOCKS</code> 5.</p>

</dd>
</dl>

<dl>

<dt id="I_SOCKS"><a class="permalink" href="perlapi.html#I_SOCKS">#</a><code>I_SOCKS</code> </dt>
<dd>

<p>This symbol, if defined, indicates that <i>socks.h</i> exists and should be included.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SOCKS
    #include &lt;socks.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_SYS_SOCKIO"><a class="permalink" href="perlapi.html#I_SYS_SOCKIO">#</a><code>I_SYS_SOCKIO</code> </dt>
<dd>

<p>This symbol, if defined, indicates the <i>sys/sockio.h</i> should be included to get socket ioctl options, like <code>SIOCATMARK</code>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_SYS_SOCKIO
    #include &lt;sys_sockio.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<h1 id="Source-Filters"><a class="permalink" href="perlapi.html#Source-Filters">#</a><a id="Source"></a>Source Filters</h1>

<dl>

<dt id="filter_add"><a class="permalink" href="perlapi.html#filter_add">#</a><code>filter_add</code></dt>
<dd>

<p>Described in <a href="perlfilter.html">perlfilter</a>.</p>

<ul>

<pre><code class="plaintext">SV*  filter_add(filter_t funcp, SV* datasv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="filter_read"><a class="permalink" href="perlapi.html#filter_read">#</a><code>filter_read</code></dt>
<dd>

<p>Described in <a href="perlfilter.html">perlfilter</a>.</p>

<ul>

<pre><code class="plaintext">I32  filter_read(int idx, SV *buf_sv, int maxlen)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Stack-Manipulation-Macros"><a class="permalink" href="perlapi.html#Stack-Manipulation-Macros">#</a><a id="Stack"></a>Stack Manipulation Macros</h1>

<dl>

<dt id="BHK"><a class="permalink" href="perlapi.html#BHK">#</a><code>BHK</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="BINOP"><a class="permalink" href="perlapi.html#BINOP">#</a><code>BINOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="DESTRUCTORFUNC_NOCONTEXT_t"><a class="permalink" href="perlapi.html#DESTRUCTORFUNC_NOCONTEXT_t">#</a><code>DESTRUCTORFUNC_NOCONTEXT_t</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="DESTRUCTORFUNC_t"><a class="permalink" href="perlapi.html#DESTRUCTORFUNC_t">#</a><code>DESTRUCTORFUNC_t</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="dMARK"><a class="permalink" href="perlapi.html#dMARK">#</a><code>dMARK</code> </dt>
<dd>

<p>Declare a stack marker variable, <code>mark</code>, for the XSUB. See <code><a href="perlapi.html#MARK">&quot;MARK&quot;</a></code> and <code><a href="perlapi.html#dORIGMARK">&quot;dORIGMARK&quot;</a></code>.</p>

<ul>

<pre><code>dMARK;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dORIGMARK"><a class="permalink" href="perlapi.html#dORIGMARK">#</a><code>dORIGMARK</code> </dt>
<dd>

<p>Saves the original stack mark for the XSUB. See <code><a href="perlapi.html#ORIGMARK">&quot;ORIGMARK&quot;</a></code>.</p>

<ul>

<pre><code>dORIGMARK;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dSP"><a class="permalink" href="perlapi.html#dSP">#</a><code>dSP</code> </dt>
<dd>

<p>Declares a local copy of perl&#39;s stack pointer for the XSUB, available via the <code>SP</code> macro. See <code><a href="perlapi.html#SP">&quot;SP&quot;</a></code>.</p>

<ul>

<pre><code>dSP;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dTARGET"><a class="permalink" href="perlapi.html#dTARGET">#</a><code>dTARGET</code> </dt>
<dd>

<p>Declare that this function uses <code>TARG</code></p>

<ul>

<pre><code>dTARGET;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="EXTEND"><a class="permalink" href="perlapi.html#EXTEND">#</a><code>EXTEND</code> </dt>
<dd>

<p>Used to extend the argument stack for an XSUB&#39;s return values. Once used, guarantees that there is room for at least <code>nitems</code> to be pushed onto the stack.</p>

<ul>

<pre><code class="plaintext">void  EXTEND(SP, SSize_t nitems)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LISTOP"><a class="permalink" href="perlapi.html#LISTOP">#</a><code>LISTOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="LOGOP"><a class="permalink" href="perlapi.html#LOGOP">#</a><code>LOGOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="LOOP"><a class="permalink" href="perlapi.html#LOOP">#</a><code>LOOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="MARK"><a class="permalink" href="perlapi.html#MARK">#</a><code>MARK</code> </dt>
<dd>

<p>Stack marker variable for the XSUB. See <code><a href="perlapi.html#dMARK">&quot;dMARK&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="mPUSHi"><a class="permalink" href="perlapi.html#mPUSHi">#</a><code>mPUSHi</code> </dt>
<dd>

<p>Push an integer onto the stack. The stack must have room for this element. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHi">&quot;PUSHi&quot;</a></code>, <code><a href="perlapi.html#mXPUSHi">&quot;mXPUSHi&quot;</a></code> and <code><a href="perlapi.html#XPUSHi">&quot;XPUSHi&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mPUSHi(IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mPUSHn"><a class="permalink" href="perlapi.html#mPUSHn">#</a><code>mPUSHn</code> </dt>
<dd>

<p>Push a double onto the stack. The stack must have room for this element. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHn">&quot;PUSHn&quot;</a></code>, <code><a href="perlapi.html#mXPUSHn">&quot;mXPUSHn&quot;</a></code> and <code><a href="perlapi.html#XPUSHn">&quot;XPUSHn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mPUSHn(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mPUSHp"><a class="permalink" href="perlapi.html#mPUSHp">#</a><code>mPUSHp</code> </dt>
<dd>

<p>Push a string onto the stack. The stack must have room for this element. The <code>len</code> indicates the length of the string. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHp">&quot;PUSHp&quot;</a></code>, <code><a href="perlapi.html#mXPUSHp">&quot;mXPUSHp&quot;</a></code> and <code><a href="perlapi.html#XPUSHp">&quot;XPUSHp&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mPUSHp(char* str, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mPUSHs"><a class="permalink" href="perlapi.html#mPUSHs">#</a><code>mPUSHs</code> </dt>
<dd>

<p>Push an SV onto the stack and mortalizes the SV. The stack must have room for this element. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHs">&quot;PUSHs&quot;</a></code> and <code><a href="perlapi.html#mXPUSHs">&quot;mXPUSHs&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mPUSHs(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mPUSHu"><a class="permalink" href="perlapi.html#mPUSHu">#</a><code>mPUSHu</code> </dt>
<dd>

<p>Push an unsigned integer onto the stack. The stack must have room for this element. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHu">&quot;PUSHu&quot;</a></code>, <code><a href="perlapi.html#mXPUSHu">&quot;mXPUSHu&quot;</a></code> and <code><a href="perlapi.html#XPUSHu">&quot;XPUSHu&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mPUSHu(UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mXPUSHi"><a class="permalink" href="perlapi.html#mXPUSHi">#</a><code>mXPUSHi</code> </dt>
<dd>

<p>Push an integer onto the stack, extending the stack if necessary. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHi">&quot;XPUSHi&quot;</a></code>, <code><a href="perlapi.html#mPUSHi">&quot;mPUSHi&quot;</a></code> and <code><a href="perlapi.html#PUSHi">&quot;PUSHi&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mXPUSHi(IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mXPUSHn"><a class="permalink" href="perlapi.html#mXPUSHn">#</a><code>mXPUSHn</code> </dt>
<dd>

<p>Push a double onto the stack, extending the stack if necessary. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHn">&quot;XPUSHn&quot;</a></code>, <code><a href="perlapi.html#mPUSHn">&quot;mPUSHn&quot;</a></code> and <code><a href="perlapi.html#PUSHn">&quot;PUSHn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mXPUSHn(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mXPUSHp"><a class="permalink" href="perlapi.html#mXPUSHp">#</a><code>mXPUSHp</code> </dt>
<dd>

<p>Push a string onto the stack, extending the stack if necessary. The <code>len</code> indicates the length of the string. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHp">&quot;XPUSHp&quot;</a></code>, <code>mPUSHp</code> and <code>PUSHp</code>.</p>

<ul>

<pre><code class="plaintext">void  mXPUSHp(char* str, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mXPUSHs"><a class="permalink" href="perlapi.html#mXPUSHs">#</a><code>mXPUSHs</code> </dt>
<dd>

<p>Push an SV onto the stack, extending the stack if necessary and mortalizes the SV. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHs">&quot;XPUSHs&quot;</a></code> and <code><a href="perlapi.html#mPUSHs">&quot;mPUSHs&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mXPUSHs(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="mXPUSHu"><a class="permalink" href="perlapi.html#mXPUSHu">#</a><code>mXPUSHu</code> </dt>
<dd>

<p>Push an unsigned integer onto the stack, extending the stack if necessary. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHu">&quot;XPUSHu&quot;</a></code>, <code><a href="perlapi.html#mPUSHu">&quot;mPUSHu&quot;</a></code> and <code><a href="perlapi.html#PUSHu">&quot;PUSHu&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  mXPUSHu(UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newXSproto"><a class="permalink" href="perlapi.html#newXSproto">#</a><code>newXSproto</code> </dt>
<dd>

<p>Used by <code>xsubpp</code> to hook up XSUBs as Perl subs. Adds Perl prototypes to the subs.</p>

</dd>
</dl>

<dl>

<dt id="OP"><a class="permalink" href="perlapi.html#OP">#</a><code>OP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="ORIGMARK"><a class="permalink" href="perlapi.html#ORIGMARK">#</a><code>ORIGMARK</code> </dt>
<dd>

<p>The original stack mark for the XSUB. See <code><a href="perlapi.html#dORIGMARK">&quot;dORIGMARK&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="peep_t"><a class="permalink" href="perlapi.html#peep_t">#</a><code>peep_t</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="PL_runops"><a class="permalink" href="perlapi.html#PL_runops">#</a><code>PL_runops</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="PMOP"><a class="permalink" href="perlapi.html#PMOP">#</a><code>PMOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="POPi"><a class="permalink" href="perlapi.html#POPi">#</a><code>POPi</code> </dt>
<dd>

<p>Pops an integer off the stack.</p>

<ul>

<pre><code class="plaintext">IV  POPi</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPl"><a class="permalink" href="perlapi.html#POPl">#</a><code>POPl</code> </dt>
<dd>

<p>Pops a long off the stack.</p>

<ul>

<pre><code class="plaintext">long  POPl</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPn"><a class="permalink" href="perlapi.html#POPn">#</a><code>POPn</code> </dt>
<dd>

<p>Pops a double off the stack.</p>

<ul>

<pre><code class="plaintext">NV  POPn</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPp"><a class="permalink" href="perlapi.html#POPp">#</a><code>POPp</code> </dt>
<dd>

<p>Pops a string off the stack.</p>

<ul>

<pre><code class="plaintext">char*  POPp</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPpbytex"><a class="permalink" href="perlapi.html#POPpbytex">#</a><code>POPpbytex</code> </dt>
<dd>

<p>Pops a string off the stack which must consist of bytes i.e. characters &lt; 256.</p>

<ul>

<pre><code class="plaintext">char*  POPpbytex</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPpx"><a class="permalink" href="perlapi.html#POPpx">#</a><code>POPpx</code> </dt>
<dd>

<p>Pops a string off the stack. Identical to POPp. There are two names for historical reasons.</p>

<ul>

<pre><code class="plaintext">char*  POPpx</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPs"><a class="permalink" href="perlapi.html#POPs">#</a><code>POPs</code> </dt>
<dd>

<p>Pops an SV off the stack.</p>

<ul>

<pre><code class="plaintext">SV*  POPs</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPu"><a class="permalink" href="perlapi.html#POPu">#</a><code>POPu</code> </dt>
<dd>

<p>Pops an unsigned integer off the stack.</p>

<ul>

<pre><code class="plaintext">UV  POPu</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="POPul"><a class="permalink" href="perlapi.html#POPul">#</a><code>POPul</code> </dt>
<dd>

<p>Pops an unsigned long off the stack.</p>

<ul>

<pre><code class="plaintext">long  POPul</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHi"><a class="permalink" href="perlapi.html#PUSHi">#</a><code>PUSHi</code> </dt>
<dd>

<p>Push an integer onto the stack. The stack must have room for this element. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mPUSHi">&quot;mPUSHi&quot;</a></code> instead. See also <code><a href="perlapi.html#XPUSHi">&quot;XPUSHi&quot;</a></code> and <code><a href="perlapi.html#mXPUSHi">&quot;mXPUSHi&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHi(IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHMARK"><a class="permalink" href="perlapi.html#PUSHMARK">#</a><code>PUSHMARK</code> </dt>
<dd>

<p>Opening bracket for arguments on a callback. See <code><a href="perlapi.html#PUTBACK">&quot;PUTBACK&quot;</a></code> and <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code class="plaintext">void  PUSHMARK(SP)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHmortal"><a class="permalink" href="perlapi.html#PUSHmortal">#</a><code>PUSHmortal</code> </dt>
<dd>

<p>Push a new mortal SV onto the stack. The stack must have room for this element. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHs">&quot;PUSHs&quot;</a></code>, <code><a href="perlapi.html#XPUSHmortal">&quot;XPUSHmortal&quot;</a></code> and <code><a href="perlapi.html#XPUSHs">&quot;XPUSHs&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHmortal</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHn"><a class="permalink" href="perlapi.html#PUSHn">#</a><code>PUSHn</code> </dt>
<dd>

<p>Push a double onto the stack. The stack must have room for this element. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mPUSHn">&quot;mPUSHn&quot;</a></code> instead. See also <code><a href="perlapi.html#XPUSHn">&quot;XPUSHn&quot;</a></code> and <code><a href="perlapi.html#mXPUSHn">&quot;mXPUSHn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHn(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHp"><a class="permalink" href="perlapi.html#PUSHp">#</a><code>PUSHp</code> </dt>
<dd>

<p>Push a string onto the stack. The stack must have room for this element. The <code>len</code> indicates the length of the string. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mPUSHp">&quot;mPUSHp&quot;</a></code> instead. See also <code><a href="perlapi.html#XPUSHp">&quot;XPUSHp&quot;</a></code> and <code><a href="perlapi.html#mXPUSHp">&quot;mXPUSHp&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHp(char* str, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHs"><a class="permalink" href="perlapi.html#PUSHs">#</a><code>PUSHs</code> </dt>
<dd>

<p>Push an SV onto the stack. The stack must have room for this element. Does not handle &#39;set&#39; magic. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#PUSHmortal">&quot;PUSHmortal&quot;</a></code>, <code><a href="perlapi.html#XPUSHs">&quot;XPUSHs&quot;</a></code>, and <code><a href="perlapi.html#XPUSHmortal">&quot;XPUSHmortal&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHs(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUSHu"><a class="permalink" href="perlapi.html#PUSHu">#</a><code>PUSHu</code> </dt>
<dd>

<p>Push an unsigned integer onto the stack. The stack must have room for this element. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mPUSHu">&quot;mPUSHu&quot;</a></code> instead. See also <code><a href="perlapi.html#XPUSHu">&quot;XPUSHu&quot;</a></code> and <code><a href="perlapi.html#mXPUSHu">&quot;mXPUSHu&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  PUSHu(UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PUTBACK"><a class="permalink" href="perlapi.html#PUTBACK">#</a><code>PUTBACK</code> </dt>
<dd>

<p>Closing bracket for XSUB arguments. This is usually handled by <code>xsubpp</code>. See <code><a href="perlapi.html#PUSHMARK">&quot;PUSHMARK&quot;</a></code> and <a href="perlcall.html">perlcall</a> for other uses.</p>

<ul>

<pre><code>PUTBACK;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_aptr"><a class="permalink" href="perlapi.html#save_aptr">#</a><code>save_aptr</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  save_aptr(AV** aptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_ary"><a class="permalink" href="perlapi.html#save_ary">#</a><code>save_ary</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">AV*  save_ary(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEBOOL"><a class="permalink" href="perlapi.html#SAVEBOOL">#</a><code>SAVEBOOL</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEBOOL(bool i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEDELETE"><a class="permalink" href="perlapi.html#SAVEDELETE">#</a><code>SAVEDELETE</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEDELETE(HV * hv, char * key, I32 length)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEDESTRUCTOR"><a class="permalink" href="perlapi.html#SAVEDESTRUCTOR">#</a><code>SAVEDESTRUCTOR</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEDESTRUCTOR(DESTRUCTORFUNC_NOCONTEXT_t f, void *p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEDESTRUCTOR_X"><a class="permalink" href="perlapi.html#SAVEDESTRUCTOR_X">#</a><code>SAVEDESTRUCTOR_X</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEDESTRUCTOR_X(DESTRUCTORFUNC_t f, void *p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEFREEOP"><a class="permalink" href="perlapi.html#SAVEFREEOP">#</a><code>SAVEFREEOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEFREEOP(OP *op)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEFREEPV"><a class="permalink" href="perlapi.html#SAVEFREEPV">#</a><code>SAVEFREEPV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEFREEPV(void * p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEFREESV"><a class="permalink" href="perlapi.html#SAVEFREESV">#</a><code>SAVEFREESV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEFREESV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_hash"><a class="permalink" href="perlapi.html#save_hash">#</a><code>save_hash</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">HV*  save_hash(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_hptr"><a class="permalink" href="perlapi.html#save_hptr">#</a><code>save_hptr</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  save_hptr(HV** hptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEI8"><a class="permalink" href="perlapi.html#SAVEI8">#</a><code>SAVEI8</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEI8(I8 i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEI32"><a class="permalink" href="perlapi.html#SAVEI32">#</a><code>SAVEI32</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEI32(I32 i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEI16"><a class="permalink" href="perlapi.html#SAVEI16">#</a><code>SAVEI16</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEI16(I16 i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEINT"><a class="permalink" href="perlapi.html#SAVEINT">#</a><code>SAVEINT</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEINT(int i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_item"><a class="permalink" href="perlapi.html#save_item">#</a><code>save_item</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  save_item(SV* item)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEIV"><a class="permalink" href="perlapi.html#SAVEIV">#</a><code>SAVEIV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEIV(IV i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_list"><a class="permalink" href="perlapi.html#save_list">#</a><code>save_list</code></dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>save_list</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  save_list(SV** sarg, I32 maxsarg)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVELONG"><a class="permalink" href="perlapi.html#SAVELONG">#</a><code>SAVELONG</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVELONG(long i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEMORTALIZESV"><a class="permalink" href="perlapi.html#SAVEMORTALIZESV">#</a><code>SAVEMORTALIZESV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEMORTALIZESV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVEPPTR"><a class="permalink" href="perlapi.html#SAVEPPTR">#</a><code>SAVEPPTR</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVEPPTR(char * p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_scalar"><a class="permalink" href="perlapi.html#save_scalar">#</a><code>save_scalar</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SV*  save_scalar(GV* gv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVESPTR"><a class="permalink" href="perlapi.html#SAVESPTR">#</a><code>SAVESPTR</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVESPTR(SV * s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVESTACK_POS"><a class="permalink" href="perlapi.html#SAVESTACK_POS">#</a><code>SAVESTACK_POS</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SAVESTACK_POS()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="save_svref"><a class="permalink" href="perlapi.html#save_svref">#</a><code>save_svref</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

<ul>

<pre><code class="plaintext">SV*  save_svref(SV** sptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SP"><a class="permalink" href="perlapi.html#SP">#</a><code>SP</code> </dt>
<dd>

<p>Stack pointer. This is usually handled by <code>xsubpp</code>. See <code><a href="perlapi.html#dSP">&quot;dSP&quot;</a></code> and <code>SPAGAIN</code>.</p>

</dd>
</dl>

<dl>

<dt id="SPAGAIN"><a class="permalink" href="perlapi.html#SPAGAIN">#</a><code>SPAGAIN</code> </dt>
<dd>

<p>Refetch the stack pointer. Used after a callback. See <a href="perlcall.html">perlcall</a>.</p>

<ul>

<pre><code>SPAGAIN;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="TARG"><a class="permalink" href="perlapi.html#TARG">#</a><code>TARG</code> </dt>
<dd>

<p><code>TARG</code> is short for &quot;target&quot;. It is an entry in the pad that an OPs <code>op_targ</code> refers to. It is scratchpad space, often used as a return value for the OP, but some use it for other purposes.</p>

<ul>

<pre><code>TARG;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UNOP"><a class="permalink" href="perlapi.html#UNOP">#</a><code>UNOP</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="XPUSHi"><a class="permalink" href="perlapi.html#XPUSHi">#</a><code>XPUSHi</code> </dt>
<dd>

<p>Push an integer onto the stack, extending the stack if necessary. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mXPUSHi">&quot;mXPUSHi&quot;</a></code> instead. See also <code><a href="perlapi.html#PUSHi">&quot;PUSHi&quot;</a></code> and <code><a href="perlapi.html#mPUSHi">&quot;mPUSHi&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHi(IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XPUSHmortal"><a class="permalink" href="perlapi.html#XPUSHmortal">#</a><code>XPUSHmortal</code> </dt>
<dd>

<p>Push a new mortal SV onto the stack, extending the stack if necessary. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHs">&quot;XPUSHs&quot;</a></code>, <code><a href="perlapi.html#PUSHmortal">&quot;PUSHmortal&quot;</a></code> and <code><a href="perlapi.html#PUSHs">&quot;PUSHs&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHmortal</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XPUSHn"><a class="permalink" href="perlapi.html#XPUSHn">#</a><code>XPUSHn</code> </dt>
<dd>

<p>Push a double onto the stack, extending the stack if necessary. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mXPUSHn">&quot;mXPUSHn&quot;</a></code> instead. See also <code><a href="perlapi.html#PUSHn">&quot;PUSHn&quot;</a></code> and <code><a href="perlapi.html#mPUSHn">&quot;mPUSHn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHn(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XPUSHp"><a class="permalink" href="perlapi.html#XPUSHp">#</a><code>XPUSHp</code> </dt>
<dd>

<p>Push a string onto the stack, extending the stack if necessary. The <code>len</code> indicates the length of the string. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mXPUSHp">&quot;mXPUSHp&quot;</a></code> instead. See also <code><a href="perlapi.html#PUSHp">&quot;PUSHp&quot;</a></code> and <code><a href="perlapi.html#mPUSHp">&quot;mPUSHp&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHp(char* str, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XPUSHs"><a class="permalink" href="perlapi.html#XPUSHs">#</a><code>XPUSHs</code> </dt>
<dd>

<p>Push an SV onto the stack, extending the stack if necessary. Does not handle &#39;set&#39; magic. Does not use <code>TARG</code>. See also <code><a href="perlapi.html#XPUSHmortal">&quot;XPUSHmortal&quot;</a></code>, <code>PUSHs</code> and <code>PUSHmortal</code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHs(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XPUSHu"><a class="permalink" href="perlapi.html#XPUSHu">#</a><code>XPUSHu</code> </dt>
<dd>

<p>Push an unsigned integer onto the stack, extending the stack if necessary. Handles &#39;set&#39; magic. Uses <code>TARG</code>, so <code>dTARGET</code> or <code>dXSTARG</code> should be called to declare it. Do not call multiple <code>TARG</code>-oriented macros to return lists from XSUB&#39;s - see <code><a href="perlapi.html#mXPUSHu">&quot;mXPUSHu&quot;</a></code> instead. See also <code><a href="perlapi.html#PUSHu">&quot;PUSHu&quot;</a></code> and <code><a href="perlapi.html#mPUSHu">&quot;mPUSHu&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  XPUSHu(UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XS_APIVERSION_BOOTCHECK"><a class="permalink" href="perlapi.html#XS_APIVERSION_BOOTCHECK">#</a><code>XS_APIVERSION_BOOTCHECK</code> </dt>
<dd>

<p>Macro to verify that the perl api version an XS module has been compiled against matches the api version of the perl interpreter it&#39;s being loaded into.</p>

<ul>

<pre><code>XS_APIVERSION_BOOTCHECK;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN"><a class="permalink" href="perlapi.html#XSRETURN">#</a><code>XSRETURN</code> </dt>
<dd>

<p>Return from XSUB, indicating number of items on the stack. This is usually handled by <code>xsubpp</code>.</p>

<ul>

<pre><code class="plaintext">void  XSRETURN(int nitems)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_EMPTY"><a class="permalink" href="perlapi.html#XSRETURN_EMPTY">#</a><code>XSRETURN_EMPTY</code> </dt>
<dd>

<p>Return an empty list from an XSUB immediately.</p>

<ul>

<pre><code>XSRETURN_EMPTY;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_IV"><a class="permalink" href="perlapi.html#XSRETURN_IV">#</a><code>XSRETURN_IV</code> </dt>
<dd>

<p>Return an integer from an XSUB immediately. Uses <code>XST_mIV</code>.</p>

<ul>

<pre><code class="plaintext">void  XSRETURN_IV(IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_NO"><a class="permalink" href="perlapi.html#XSRETURN_NO">#</a><code>XSRETURN_NO</code> </dt>
<dd>

<p>Return <code>&amp;PL_sv_no</code> from an XSUB immediately. Uses <code>XST_mNO</code>.</p>

<ul>

<pre><code>XSRETURN_NO;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_NV"><a class="permalink" href="perlapi.html#XSRETURN_NV">#</a><code>XSRETURN_NV</code> </dt>
<dd>

<p>Return a double from an XSUB immediately. Uses <code>XST_mNV</code>.</p>

<ul>

<pre><code class="plaintext">void  XSRETURN_NV(NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_PV"><a class="permalink" href="perlapi.html#XSRETURN_PV">#</a><code>XSRETURN_PV</code> </dt>
<dd>

<p>Return a copy of a string from an XSUB immediately. Uses <code>XST_mPV</code>.</p>

<ul>

<pre><code class="plaintext">void  XSRETURN_PV(char* str)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_UNDEF"><a class="permalink" href="perlapi.html#XSRETURN_UNDEF">#</a><code>XSRETURN_UNDEF</code> </dt>
<dd>

<p>Return <code>&amp;PL_sv_undef</code> from an XSUB immediately. Uses <code>XST_mUNDEF</code>.</p>

<ul>

<pre><code>XSRETURN_UNDEF;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_UV"><a class="permalink" href="perlapi.html#XSRETURN_UV">#</a><code>XSRETURN_UV</code> </dt>
<dd>

<p>Return an integer from an XSUB immediately. Uses <code>XST_mUV</code>.</p>

<ul>

<pre><code class="plaintext">void  XSRETURN_UV(IV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XSRETURN_YES"><a class="permalink" href="perlapi.html#XSRETURN_YES">#</a><code>XSRETURN_YES</code> </dt>
<dd>

<p>Return <code>&amp;PL_sv_yes</code> from an XSUB immediately. Uses <code>XST_mYES</code>.</p>

<ul>

<pre><code>XSRETURN_YES;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mIV"><a class="permalink" href="perlapi.html#XST_mIV">#</a><code>XST_mIV</code> </dt>
<dd>

<p>Place an integer into the specified position <code>pos</code> on the stack. The value is stored in a new mortal SV.</p>

<ul>

<pre><code class="plaintext">void  XST_mIV(int pos, IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mNO"><a class="permalink" href="perlapi.html#XST_mNO">#</a><code>XST_mNO</code> </dt>
<dd>

<p>Place <code>&amp;PL_sv_no</code> into the specified position <code>pos</code> on the stack.</p>

<ul>

<pre><code class="plaintext">void  XST_mNO(int pos)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mNV"><a class="permalink" href="perlapi.html#XST_mNV">#</a><code>XST_mNV</code> </dt>
<dd>

<p>Place a double into the specified position <code>pos</code> on the stack. The value is stored in a new mortal SV.</p>

<ul>

<pre><code class="plaintext">void  XST_mNV(int pos, NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mPV"><a class="permalink" href="perlapi.html#XST_mPV">#</a><code>XST_mPV</code> </dt>
<dd>

<p>Place a copy of a string into the specified position <code>pos</code> on the stack. The value is stored in a new mortal SV.</p>

<ul>

<pre><code class="plaintext">void  XST_mPV(int pos, char* str)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mUNDEF"><a class="permalink" href="perlapi.html#XST_mUNDEF">#</a><code>XST_mUNDEF</code> </dt>
<dd>

<p>Place <code>&amp;PL_sv_undef</code> into the specified position <code>pos</code> on the stack.</p>

<ul>

<pre><code class="plaintext">void  XST_mUNDEF(int pos)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mUV"><a class="permalink" href="perlapi.html#XST_mUV">#</a><code>XST_mUV</code> </dt>
<dd>

<p>Place an unsigned integer into the specified position <code>pos</code> on the stack. The value is stored in a new mortal SV.</p>

<ul>

<pre><code class="plaintext">void  XST_mUV(int pos, UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XST_mYES"><a class="permalink" href="perlapi.html#XST_mYES">#</a><code>XST_mYES</code> </dt>
<dd>

<p>Place <code>&amp;PL_sv_yes</code> into the specified position <code>pos</code> on the stack.</p>

<ul>

<pre><code class="plaintext">void  XST_mYES(int pos)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="XS_VERSION"><a class="permalink" href="perlapi.html#XS_VERSION">#</a><code>XS_VERSION</code> </dt>
<dd>

<p>The version identifier for an XS module. This is usually handled automatically by <code>ExtUtils::MakeMaker</code>. See <code><a href="perlapi.html#XS_VERSION_BOOTCHECK">&quot;XS_VERSION_BOOTCHECK&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="XS_VERSION_BOOTCHECK"><a class="permalink" href="perlapi.html#XS_VERSION_BOOTCHECK">#</a><code>XS_VERSION_BOOTCHECK</code> </dt>
<dd>

<p>Macro to verify that a PM module&#39;s <code>$VERSION</code> variable matches the XS module&#39;s <code>XS_VERSION</code> variable. This is usually handled automatically by <code>xsubpp</code>. See <a href="perlxs.html#The-VERSIONCHECK%3A-Keyword">&quot;The VERSIONCHECK: Keyword&quot; in perlxs</a>.</p>

<ul>

<pre><code>XS_VERSION_BOOTCHECK;</code></pre>

</ul>

</dd>
</dl>

<h1 id="String-Handling"><a class="permalink" href="perlapi.html#String-Handling">#</a><a id="String"></a>String Handling</h1>

<p>See also <code><a href="perlapi.html#Unicode-Support">&quot;Unicode Support&quot;</a></code>.</p>

<dl>

<dt id="CAT2"><a class="permalink" href="perlapi.html#CAT2">#</a><code>CAT2</code> </dt>
<dd>

<p>This macro concatenates 2 tokens together.</p>

<ul>

<pre><code class="plaintext">token  CAT2(token x, token y)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Copy"><a class="permalink" href="perlapi.html#Copy">#</a><code>Copy</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>memcpy</code> function. The <code>src</code> is the source, <code>dest</code> is the destination, <code>nitems</code> is the number of items, and <code>type</code> is the type. May fail on overlapping copies. See also <code><a href="perlapi.html#Move">&quot;Move&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  Copy(void* src, void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CopyD"><a class="permalink" href="perlapi.html#CopyD">#</a><code>CopyD</code> </dt>
<dd>

<p>Like <code>Copy</code> but returns <code>dest</code>. Useful for encouraging compilers to tail-call optimise.</p>

<ul>

<pre><code class="plaintext">void *  CopyD(void* src, void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="delimcpy"><a class="permalink" href="perlapi.html#delimcpy">#</a><code>delimcpy</code> </dt>
<dd>

<p>Copy a source buffer to a destination buffer, stopping at (but not including) the first occurrence in the source of an unescaped (defined below) delimiter byte, <code>delim</code>. The source is the bytes between <span style="white-space: nowrap;"><code>from</code> and <code>from_end</code> - 1</span>. Similarly, the dest is <code>to</code> up to <code>to_end</code>.</p>

<p>The number of bytes copied is written to <code>*retlen</code>.</p>

<p>Returns the position of the first uncopied <code>delim</code> in the <code>from</code> buffer, but if there is no such occurrence before <code>from_end</code>, then <code>from_end</code> is returned, and the entire buffer <span style="white-space: nowrap;"><code>from</code> .. <code>from_end</code> - 1</span> is copied.</p>

<p>If there is room in the destination available after the copy, an extra terminating safety <code>NUL</code> byte is appended (not included in the returned length).</p>

<p>The error case is if the destination buffer is not large enough to accommodate everything that should be copied. In this situation, a value larger than <span style="white-space: nowrap;"><code>to_end</code> - <code>to</code></span> is written to <code>*retlen</code>, and as much of the source as fits will be written to the destination. Not having room for the safety <code>NUL</code> is not considered an error.</p>

<p>In the following examples, let <code>x</code> be the delimiter, and <code>0</code> represent a <code>NUL</code> byte (<b>NOT</b> the digit <code>0</code>). Then we would have</p>

<pre><code class="plaintext"> Source     Destination
abcxdef        abc0</code></pre>

<p>provided the destination buffer is at least 4 bytes long.</p>

<p>An escaped delimiter is one which is immediately preceded by a single backslash. Escaped delimiters are copied, and the copy continues past the delimiter; the backslash is not copied:</p>

<pre><code class="plaintext"> Source       Destination
abc\xdef       abcxdef0</code></pre>

<p>(provided the destination buffer is at least 8 bytes long).</p>

<p>It&#39;s actually somewhat more complicated than that. A sequence of any odd number of backslashes escapes the following delimiter, and the copy continues with exactly one of the backslashes stripped.</p>

<pre><code class="plaintext">    Source         Destination
    abc\xdef          abcxdef0
  abc\\\xdef        abc\\xdef0
abc\\\\\xdef      abc\\\\xdef0</code></pre>

<p>(as always, if the destination is large enough)</p>

<p>An even number of preceding backslashes does not escape the delimiter, so that the copy stops just before it, and includes all the backslashes (no stripping; zero is considered even):</p>

<pre><code class="plaintext">    Source         Destination
    abcxdef          abc0
  abc\\xdef          abc\\0
abc\\\\xdef          abc\\\\0</code></pre>

<ul>

<pre><code class="plaintext">char*  delimcpy(char* to, const char* to_end, const char* from,
                const char* from_end, const int delim,
                I32* retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="fbm_compile"><a class="permalink" href="perlapi.html#fbm_compile">#</a><code>fbm_compile</code> </dt>
<dd>

<p>Analyzes the string in order to make fast searches on it using <code>fbm_instr()</code> -- the Boyer-Moore algorithm.</p>

<ul>

<pre><code class="plaintext">void  fbm_compile(SV* sv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="fbm_instr"><a class="permalink" href="perlapi.html#fbm_instr">#</a><code>fbm_instr</code> </dt>
<dd>

<p>Returns the location of the SV in the string delimited by <code>big</code> and <code>bigend</code> (<code>bigend</code>) is the char following the last char). It returns <code>NULL</code> if the string can&#39;t be found. The <code>sv</code> does not have to be <code>fbm_compiled</code>, but the search will not be as fast then.</p>

<ul>

<pre><code class="plaintext">char*  fbm_instr(unsigned char* big, unsigned char* bigend,
                 SV* littlestr, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="foldEQ"><a class="permalink" href="perlapi.html#foldEQ">#</a><code>foldEQ</code> </dt>
<dd>

<p>Returns true if the leading <code>len</code> bytes of the strings <code>s1</code> and <code>s2</code> are the same case-insensitively; false otherwise. Uppercase and lowercase ASCII range bytes match themselves and their opposite case counterparts. Non-cased and non-ASCII range bytes match only themselves.</p>

<ul>

<pre><code class="plaintext">I32  foldEQ(const char* a, const char* b, I32 len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ibcmp"><a class="permalink" href="perlapi.html#ibcmp">#</a><code>ibcmp</code> </dt>
<dd>

<p>This is a synonym for <span style="white-space: nowrap;"><code>(! foldEQ())</code></span></p>

<ul>

<pre><code class="plaintext">I32  ibcmp(const char* a, const char* b, I32 len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ibcmp_locale"><a class="permalink" href="perlapi.html#ibcmp_locale">#</a><code>ibcmp_locale</code> </dt>
<dd>

<p>This is a synonym for <span style="white-space: nowrap;"><code>(! foldEQ_locale())</code></span></p>

<ul>

<pre><code class="plaintext">I32  ibcmp_locale(const char* a, const char* b, I32 len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ibcmp_utf8"><a class="permalink" href="perlapi.html#ibcmp_utf8">#</a><code>ibcmp_utf8</code> </dt>
<dd>

<p>This is a synonym for <span style="white-space: nowrap;"><code>(! foldEQ_utf8())</code></span></p>

<ul>

<pre><code class="plaintext">I32  ibcmp_utf8(const char *s1, char **pe1, UV l1, bool u1,
                const char *s2, char **pe2, UV l2, bool u2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="instr"><a class="permalink" href="perlapi.html#instr">#</a><code>instr</code> </dt>
<dd>

<p>Same as <a href="http://man.he.net/man3/strstr">strstr(3)</a>, which finds and returns a pointer to the first occurrence of the NUL-terminated substring <code>little</code> in the NUL-terminated string <code>big</code>, returning NULL if not found. The terminating NUL bytes are not compared.</p>

<ul>

<pre><code class="plaintext">char*  instr(const char* big, const char* little)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="memCHRs"><a class="permalink" href="perlapi.html#memCHRs">#</a><code>memCHRs</code> </dt>
<dd>

<p>Returns the position of the first occurence of the byte <code>c</code> in the literal string <code>&quot;list&quot;</code>, or NULL if <code>c</code> doesn&#39;t appear in <code>&quot;list&quot;</code>. All bytes are treated as unsigned char. Thus this macro can be used to determine if <code>c</code> is in a set of particular characters. Unlike <a href="http://man.he.net/man3/strchr">strchr(3)</a>, it works even if <code>c</code> is <code>NUL</code> (and the set doesn&#39;t include <code>NUL</code>).</p>

<ul>

<pre><code class="plaintext">bool  memCHRs(&quot;list&quot;, char c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="memEQ"><a class="permalink" href="perlapi.html#memEQ">#</a><code>memEQ</code> </dt>
<dd>

<p>Test two buffers (which may contain embedded <code>NUL</code> characters, to see if they are equal. The <code>len</code> parameter indicates the number of bytes to compare. Returns true or false. It is undefined behavior if either of the buffers doesn&#39;t contain at least <code>len</code> bytes.</p>

<ul>

<pre><code class="plaintext">bool  memEQ(char* s1, char* s2, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="memEQs"><a class="permalink" href="perlapi.html#memEQs">#</a><code>memEQs</code> </dt>
<dd>

<p>Like <a href="perlapi.html#memEQ">&quot;memEQ&quot;</a>, but the second string is a literal enclosed in double quotes, <code>l1</code> gives the number of bytes in <code>s1</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  memEQs(char* s1, STRLEN l1, &quot;s2&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="memNE"><a class="permalink" href="perlapi.html#memNE">#</a><code>memNE</code> </dt>
<dd>

<p>Test two buffers (which may contain embedded <code>NUL</code> characters, to see if they are not equal. The <code>len</code> parameter indicates the number of bytes to compare. Returns true or false. It is undefined behavior if either of the buffers doesn&#39;t contain at least <code>len</code> bytes.</p>

<ul>

<pre><code class="plaintext">bool  memNE(char* s1, char* s2, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="memNEs"><a class="permalink" href="perlapi.html#memNEs">#</a><code>memNEs</code> </dt>
<dd>

<p>Like <a href="perlapi.html#memNE">&quot;memNE&quot;</a>, but the second string is a literal enclosed in double quotes, <code>l1</code> gives the number of bytes in <code>s1</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  memNEs(char* s1, STRLEN l1, &quot;s2&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Move"><a class="permalink" href="perlapi.html#Move">#</a><code>Move</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>memmove</code> function. The <code>src</code> is the source, <code>dest</code> is the destination, <code>nitems</code> is the number of items, and <code>type</code> is the type. Can do overlapping moves. See also <code><a href="perlapi.html#Copy">&quot;Copy&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  Move(void* src, void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MoveD"><a class="permalink" href="perlapi.html#MoveD">#</a><code>MoveD</code> </dt>
<dd>

<p>Like <code>Move</code> but returns <code>dest</code>. Useful for encouraging compilers to tail-call optimise.</p>

<ul>

<pre><code class="plaintext">void *  MoveD(void* src, void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_snprintf"><a class="permalink" href="perlapi.html#my_snprintf">#</a><code>my_snprintf</code> </dt>
<dd>

<p>The C library <code>snprintf</code> functionality, if available and standards-compliant (uses <code>vsnprintf</code>, actually). However, if the <code>vsnprintf</code> is not available, will unfortunately use the unsafe <code>vsprintf</code> which can overrun the buffer (there is an overrun check, but that may be too late). Consider using <code>sv_vcatpvf</code> instead, or getting <code>vsnprintf</code>.</p>

<ul>

<pre><code class="plaintext">int  my_snprintf(char *buffer, const Size_t len,
                 const char *format, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_sprintf"><a class="permalink" href="perlapi.html#my_sprintf">#</a><code>my_sprintf</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>my_sprintf</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Do NOT use this due to the possibility of overflowing <code>buffer</code>. Instead use my_snprintf()</p>

<ul>

<pre><code class="plaintext">int  my_sprintf(NN char *buffer, NN const char *pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_strlcat"><a class="permalink" href="perlapi.html#my_strlcat">#</a><code>my_strlcat</code> </dt>
<dd>

<p>The C library <code>strlcat</code> if available, or a Perl implementation of it. This operates on C <code>NUL</code>-terminated strings.</p>

<p><code>my_strlcat()</code> appends string <code>src</code> to the end of <code>dst</code>. It will append at most <span style="white-space: nowrap;"><code>size - strlen(dst) - 1</code></span> characters. It will then <code>NUL</code>-terminate, unless <code>size</code> is 0 or the original <code>dst</code> string was longer than <code>size</code> (in practice this should not happen as it means that either <code>size</code> is incorrect or that <code>dst</code> is not a proper <code>NUL</code>-terminated string).</p>

<p>Note that <code>size</code> is the full size of the destination buffer and the result is guaranteed to be <code>NUL</code>-terminated if there is room. Note that room for the <code>NUL</code> should be included in <code>size</code>.</p>

<p>The return value is the total length that <code>dst</code> would have if <code>size</code> is sufficiently large. Thus it is the initial length of <code>dst</code> plus the length of <code>src</code>. If <code>size</code> is smaller than the return, the excess was not appended.</p>

<ul>

<pre><code class="plaintext">Size_t  my_strlcat(char *dst, const char *src, Size_t size)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_strlcpy"><a class="permalink" href="perlapi.html#my_strlcpy">#</a><code>my_strlcpy</code> </dt>
<dd>

<p>The C library <code>strlcpy</code> if available, or a Perl implementation of it. This operates on C <code>NUL</code>-terminated strings.</p>

<p><code>my_strlcpy()</code> copies up to <span style="white-space: nowrap;"><code>size - 1</code></span> characters from the string <code>src</code> to <code>dst</code>, <code>NUL</code>-terminating the result if <code>size</code> is not 0.</p>

<p>The return value is the total length <code>src</code> would be if the copy completely succeeded. If it is larger than <code>size</code>, the excess was not copied.</p>

<ul>

<pre><code class="plaintext">Size_t  my_strlcpy(char *dst, const char *src, Size_t size)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_strnlen"><a class="permalink" href="perlapi.html#my_strnlen">#</a><code>my_strnlen</code> </dt>
<dd>

<p>The C library <code>strnlen</code> if available, or a Perl implementation of it.</p>

<p><code>my_strnlen()</code> computes the length of the string, up to <code>maxlen</code> characters. It will never attempt to address more than <code>maxlen</code> characters, making it suitable for use with strings that are not guaranteed to be NUL-terminated.</p>

<ul>

<pre><code class="plaintext">Size_t  my_strnlen(const char *str, Size_t maxlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_vsnprintf"><a class="permalink" href="perlapi.html#my_vsnprintf">#</a><code>my_vsnprintf</code> </dt>
<dd>

<p>The C library <code>vsnprintf</code> if available and standards-compliant. However, if the <code>vsnprintf</code> is not available, will unfortunately use the unsafe <code>vsprintf</code> which can overrun the buffer (there is an overrun check, but that may be too late). Consider using <code>sv_vcatpvf</code> instead, or getting <code>vsnprintf</code>.</p>

<ul>

<pre><code class="plaintext">int  my_vsnprintf(char *buffer, const Size_t len,
                  const char *format, va_list ap)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ninstr"><a class="permalink" href="perlapi.html#ninstr">#</a><code>ninstr</code> </dt>
<dd>

<p>Find the first (leftmost) occurrence of a sequence of bytes within another sequence. This is the Perl version of <code>strstr()</code>, extended to handle arbitrary sequences, potentially containing embedded <code>NUL</code> characters (<code>NUL</code> is what the initial <code>n</code> in the function name stands for; some systems have an equivalent, <code>memmem()</code>, but with a somewhat different API).</p>

<p>Another way of thinking about this function is finding a needle in a haystack. <code>big</code> points to the first byte in the haystack. <code>big_end</code> points to one byte beyond the final byte in the haystack. <code>little</code> points to the first byte in the needle. <code>little_end</code> points to one byte beyond the final byte in the needle. All the parameters must be non-<code>NULL</code>.</p>

<p>The function returns <code>NULL</code> if there is no occurrence of <code>little</code> within <code>big</code>. If <code>little</code> is the empty string, <code>big</code> is returned.</p>

<p>Because this function operates at the byte level, and because of the inherent characteristics of UTF-8 (or UTF-EBCDIC), it will work properly if both the needle and the haystack are strings with the same UTF-8ness, but not if the UTF-8ness differs.</p>

<ul>

<pre><code class="plaintext">char*  ninstr(const char* big, const char* bigend,
              const char* little, const char* lend)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Nullch"><a class="permalink" href="perlapi.html#Nullch">#</a><code>Nullch</code> </dt>
<dd>

<p>Null character pointer. (No longer available when <code>PERL_CORE</code> is defined.)</p>

</dd>
</dl>

<dl>

<dt id="rninstr"><a class="permalink" href="perlapi.html#rninstr">#</a><code>rninstr</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#ninstr">&quot;ninstr&quot;</a></code>, but instead finds the final (rightmost) occurrence of a sequence of bytes within another sequence, returning <code>NULL</code> if there is no such occurrence.</p>

<ul>

<pre><code class="plaintext">char*  rninstr(const char* big, const char* bigend,
               const char* little, const char* lend)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savepv"><a class="permalink" href="perlapi.html#savepv">#</a><code>savepv</code> </dt>
<dd>

<p>Perl&#39;s version of <code>strdup()</code>. Returns a pointer to a newly allocated string which is a duplicate of <code>pv</code>. The size of the string is determined by <code>strlen()</code>, which means it may not contain embedded <code>NUL</code> characters and must have a trailing <code>NUL</code>. To prevent memory leaks, the memory allocated for the new string needs to be freed when no longer needed. This can be done with the <code><a href="perlapi.html#Safefree">&quot;Safefree&quot;</a></code> function, or <a href="perlguts.html#SAVEFREEPV%28p%29"><code>SAVEFREEPV</code></a>.</p>

<p>On some platforms, Windows for example, all allocated memory owned by a thread is deallocated when that thread ends. So if you need that not to happen, you need to use the shared memory functions, such as <code><a href="perlapi.html#savesharedpv">&quot;savesharedpv&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  savepv(const char* pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savepvn"><a class="permalink" href="perlapi.html#savepvn">#</a><code>savepvn</code> </dt>
<dd>

<p>Perl&#39;s version of what <code>strndup()</code> would be if it existed. Returns a pointer to a newly allocated string which is a duplicate of the first <code>len</code> bytes from <code>pv</code>, plus a trailing <code>NUL</code> byte. The memory allocated for the new string can be freed with the <code>Safefree()</code> function.</p>

<p>On some platforms, Windows for example, all allocated memory owned by a thread is deallocated when that thread ends. So if you need that not to happen, you need to use the shared memory functions, such as <code><a href="perlapi.html#savesharedpvn">&quot;savesharedpvn&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  savepvn(const char* pv, Size_t len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savepvs"><a class="permalink" href="perlapi.html#savepvs">#</a><code>savepvs</code> </dt>
<dd>

<p>Like <code>savepvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">char*  savepvs(&quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savesharedpv"><a class="permalink" href="perlapi.html#savesharedpv">#</a><code>savesharedpv</code> </dt>
<dd>

<p>A version of <code>savepv()</code> which allocates the duplicate string in memory which is shared between threads.</p>

<ul>

<pre><code class="plaintext">char*  savesharedpv(const char* pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savesharedpvn"><a class="permalink" href="perlapi.html#savesharedpvn">#</a><code>savesharedpvn</code> </dt>
<dd>

<p>A version of <code>savepvn()</code> which allocates the duplicate string in memory which is shared between threads. (With the specific difference that a <code>NULL</code> pointer is not acceptable)</p>

<ul>

<pre><code class="plaintext">char*  savesharedpvn(const char *const pv, const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savesharedpvs"><a class="permalink" href="perlapi.html#savesharedpvs">#</a><code>savesharedpvs</code> </dt>
<dd>

<p>A version of <code>savepvs()</code> which allocates the duplicate string in memory which is shared between threads.</p>

<ul>

<pre><code class="plaintext">char*  savesharedpvs(&quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savesharedsvpv"><a class="permalink" href="perlapi.html#savesharedsvpv">#</a><code>savesharedsvpv</code> </dt>
<dd>

<p>A version of <code>savesharedpv()</code> which allocates the duplicate string in memory which is shared between threads.</p>

<ul>

<pre><code class="plaintext">char*  savesharedsvpv(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="savesvpv"><a class="permalink" href="perlapi.html#savesvpv">#</a><code>savesvpv</code> </dt>
<dd>

<p>A version of <code>savepv()</code>/<code>savepvn()</code> which gets the string to duplicate from the passed in SV using <code>SvPV()</code></p>

<p>On some platforms, Windows for example, all allocated memory owned by a thread is deallocated when that thread ends. So if you need that not to happen, you need to use the shared memory functions, such as <code><a href="perlapi.html#savesharedsvpv">&quot;savesharedsvpv&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  savesvpv(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strEQ"><a class="permalink" href="perlapi.html#strEQ">#</a><code>strEQ</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if they are equal. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strEQ(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strGE"><a class="permalink" href="perlapi.html#strGE">#</a><code>strGE</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if the first, <code>s1</code>, is greater than or equal to the second, <code>s2</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strGE(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strGT"><a class="permalink" href="perlapi.html#strGT">#</a><code>strGT</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if the first, <code>s1</code>, is greater than the second, <code>s2</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strGT(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="STRINGIFY"><a class="permalink" href="perlapi.html#STRINGIFY">#</a><code>STRINGIFY</code> </dt>
<dd>

<p>This macro surrounds its token with double quotes.</p>

<ul>

<pre><code class="plaintext">string  STRINGIFY(token x)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strLE"><a class="permalink" href="perlapi.html#strLE">#</a><code>strLE</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if the first, <code>s1</code>, is less than or equal to the second, <code>s2</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strLE(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strLT"><a class="permalink" href="perlapi.html#strLT">#</a><code>strLT</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if the first, <code>s1</code>, is less than the second, <code>s2</code>. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strLT(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strNE"><a class="permalink" href="perlapi.html#strNE">#</a><code>strNE</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if they are different. Returns true or false.</p>

<ul>

<pre><code class="plaintext">bool  strNE(char* s1, char* s2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strnEQ"><a class="permalink" href="perlapi.html#strnEQ">#</a><code>strnEQ</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if they are equal. The <code>len</code> parameter indicates the number of bytes to compare. Returns true or false. (A wrapper for <code>strncmp</code>).</p>

<ul>

<pre><code class="plaintext">bool  strnEQ(char* s1, char* s2, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="strnNE"><a class="permalink" href="perlapi.html#strnNE">#</a><code>strnNE</code> </dt>
<dd>

<p>Test two <code>NUL</code>-terminated strings to see if they are different. The <code>len</code> parameter indicates the number of bytes to compare. Returns true or false. (A wrapper for <code>strncmp</code>).</p>

<ul>

<pre><code class="plaintext">bool  strnNE(char* s1, char* s2, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="STR_WITH_LEN"><a class="permalink" href="perlapi.html#STR_WITH_LEN">#</a><code>STR_WITH_LEN</code> </dt>
<dd>

<p>Returns two comma separated tokens of the input literal string, and its length. This is convenience macro which helps out in some API calls. Note that it can&#39;t be used as an argument to macros or functions that under some configurations might be macros, which means that it requires the full Perl_xxx(aTHX_ ...) form for any API calls where it&#39;s used.</p>

<ul>

<pre><code class="plaintext">pair  STR_WITH_LEN(&quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Zero"><a class="permalink" href="perlapi.html#Zero">#</a><code>Zero</code> </dt>
<dd>

<p>The XSUB-writer&#39;s interface to the C <code>memzero</code> function. The <code>dest</code> is the destination, <code>nitems</code> is the number of items, and <code>type</code> is the type.</p>

<ul>

<pre><code class="plaintext">void  Zero(void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ZeroD"><a class="permalink" href="perlapi.html#ZeroD">#</a><code>ZeroD</code> </dt>
<dd>

<p>Like <code>Zero</code> but returns dest. Useful for encouraging compilers to tail-call optimise.</p>

<ul>

<pre><code class="plaintext">void *  ZeroD(void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<h1 id="SV-Flags"><a class="permalink" href="perlapi.html#SV-Flags">#</a><a id="SV1"></a>SV Flags</h1>

<dl>

<dt id="SVt_IV"><a class="permalink" href="perlapi.html#SVt_IV">#</a><code>SVt_IV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_NULL"><a class="permalink" href="perlapi.html#SVt_NULL">#</a><code>SVt_NULL</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_NV"><a class="permalink" href="perlapi.html#SVt_NV">#</a><code>SVt_NV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PV"><a class="permalink" href="perlapi.html#SVt_PV">#</a><code>SVt_PV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVAV"><a class="permalink" href="perlapi.html#SVt_PVAV">#</a><code>SVt_PVAV</code> </dt>
<dd>

<p>Type flag for arrays. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVCV"><a class="permalink" href="perlapi.html#SVt_PVCV">#</a><code>SVt_PVCV</code> </dt>
<dd>

<p>Type flag for subroutines. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVFM"><a class="permalink" href="perlapi.html#SVt_PVFM">#</a><code>SVt_PVFM</code> </dt>
<dd>

<p>Type flag for formats. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVGV"><a class="permalink" href="perlapi.html#SVt_PVGV">#</a><code>SVt_PVGV</code> </dt>
<dd>

<p>Type flag for typeglobs. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVHV"><a class="permalink" href="perlapi.html#SVt_PVHV">#</a><code>SVt_PVHV</code> </dt>
<dd>

<p>Type flag for hashes. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVIO"><a class="permalink" href="perlapi.html#SVt_PVIO">#</a><code>SVt_PVIO</code> </dt>
<dd>

<p>Type flag for I/O objects. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVIV"><a class="permalink" href="perlapi.html#SVt_PVIV">#</a><code>SVt_PVIV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVLV"><a class="permalink" href="perlapi.html#SVt_PVLV">#</a><code>SVt_PVLV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVMG"><a class="permalink" href="perlapi.html#SVt_PVMG">#</a><code>SVt_PVMG</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_PVNV"><a class="permalink" href="perlapi.html#SVt_PVNV">#</a><code>SVt_PVNV</code> </dt>
<dd>

<p>Type flag for scalars. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="SVt_REGEXP"><a class="permalink" href="perlapi.html#SVt_REGEXP">#</a><code>SVt_REGEXP</code> </dt>
<dd>

<p>Type flag for regular expressions. See <a href="perlapi.html#svtype">&quot;svtype&quot;</a>.</p>

</dd>
</dl>

<dl>

<dt id="svtype"><a class="permalink" href="perlapi.html#svtype">#</a><code>svtype</code> </dt>
<dd>

<p>An enum of flags for Perl types. These are found in the file <i>sv.h</i> in the <code>svtype</code> enum. Test these flags with the <code>SvTYPE</code> macro.</p>

<p>The types are:</p>

<pre><code class="plaintext">SVt_NULL
SVt_IV
SVt_NV
SVt_RV
SVt_PV
SVt_PVIV
SVt_PVNV
SVt_PVMG
SVt_INVLIST
SVt_REGEXP
SVt_PVGV
SVt_PVLV
SVt_PVAV
SVt_PVHV
SVt_PVCV
SVt_PVFM
SVt_PVIO</code></pre>

<p>These are most easily explained from the bottom up.</p>

<p><code>SVt_PVIO</code> is for I/O objects, <code>SVt_PVFM</code> for formats, <code>SVt_PVCV</code> for subroutines, <code>SVt_PVHV</code> for hashes and <code>SVt_PVAV</code> for arrays.</p>

<p>All the others are scalar types, that is, things that can be bound to a <code>$</code> variable. For these, the internal types are mostly orthogonal to types in the Perl language.</p>

<p>Hence, checking <code>SvTYPE(sv) &lt; SVt_PVAV</code> is the best way to see whether something is a scalar.</p>

<p><code>SVt_PVGV</code> represents a typeglob. If <code>!SvFAKE(sv)</code>, then it is a real, incoercible typeglob. If <code>SvFAKE(sv)</code>, then it is a scalar to which a typeglob has been assigned. Assigning to it again will stop it from being a typeglob. <code>SVt_PVLV</code> represents a scalar that delegates to another scalar behind the scenes. It is used, e.g., for the return value of <code>substr</code> and for tied hash and array elements. It can hold any scalar value, including a typeglob. <code>SVt_REGEXP</code> is for regular expressions. <code>SVt_INVLIST</code> is for Perl core internal use only.</p>

<p><code>SVt_PVMG</code> represents a &quot;normal&quot; scalar (not a typeglob, regular expression, or delegate). Since most scalars do not need all the internal fields of a PVMG, we save memory by allocating smaller structs when possible. All the other types are just simpler forms of <code>SVt_PVMG</code>, with fewer internal fields. <code>SVt_NULL</code> can only hold undef. <code>SVt_IV</code> can hold undef, an integer, or a reference. (<code>SVt_RV</code> is an alias for <code>SVt_IV</code>, which exists for backward compatibility.) <code>SVt_NV</code> can hold any of those or a double. <code>SVt_PV</code> can only hold <code>undef</code> or a string. <code>SVt_PVIV</code> is a superset of <code>SVt_PV</code> and <code>SVt_IV</code>. <code>SVt_PVNV</code> is similar. <code>SVt_PVMG</code> can hold anything <code>SVt_PVNV</code> can hold, but it can, but does not have to, be blessed or magical.</p>

</dd>
</dl>

<h1 id="SV-Handling"><a class="permalink" href="perlapi.html#SV-Handling">#</a><a id="SV2"></a>SV Handling</h1>

<p>An SV (or AV, HV, etc.) is allocated in two parts: the head (struct sv, av, hv...) contains type and reference count information, and for many types, a pointer to the body (struct xrv, xpv, xpviv...), which contains fields specific to each type. Some types store all they need in the head, so don&#39;t have a body.</p>

<p>In all but the most memory-paranoid configurations (ex: PURIFY), heads and bodies are allocated out of arenas, which by default are approximately 4K chunks of memory parcelled up into N heads or bodies. Sv-bodies are allocated by their sv-type, guaranteeing size consistency needed to allocate safely from arrays.</p>

<p>For SV-heads, the first slot in each arena is reserved, and holds a link to the next arena, some flags, and a note of the number of slots. Snaked through each arena chain is a linked list of free items; when this becomes empty, an extra arena is allocated and divided up into N items which are threaded into the free list.</p>

<p>SV-bodies are similar, but they use arena-sets by default, which separate the link and info from the arena itself, and reclaim the 1st slot in the arena. SV-bodies are further described later.</p>

<p>The following global variables are associated with arenas:</p>

<pre><code class="plaintext">PL_sv_arenaroot     pointer to list of SV arenas
PL_sv_root          pointer to list of free SV structures

PL_body_arenas      head of linked-list of body arenas
PL_body_roots[]     array of pointers to list of free bodies of svtype
                    arrays are indexed by the svtype needed</code></pre>

<p>A few special SV heads are not allocated from an arena, but are instead directly created in the interpreter structure, eg PL_sv_undef. The size of arenas can be changed from the default by setting PERL_ARENA_SIZE appropriately at compile time.</p>

<p>The SV arena serves the secondary purpose of allowing still-live SVs to be located and destroyed during final cleanup.</p>

<p>At the lowest level, the macros new_SV() and del_SV() grab and free an SV head. (If debugging with -DD, del_SV() calls the function S_del_sv() to return the SV to the free list with error checking.) new_SV() calls more_sv() / sv_add_arena() to add an extra arena if the free list is empty. SVs in the free list have their SvTYPE field set to all ones.</p>

<p>At the time of very final cleanup, sv_free_arenas() is called from perl_destruct() to physically free all the arenas allocated since the start of the interpreter.</p>

<p>The internal function visit() scans the SV arenas list, and calls a specified function for each SV it finds which is still live, <i>i.e.</i> which has an SvTYPE other than all 1&#39;s, and a non-zero SvREFCNT. visit() is used by the following functions (specified as [function that calls visit()] / [function called by visit() for each SV]):</p>

<pre><code class="plaintext">    sv_report_used() / do_report_used()
			dump all remaining SVs (debugging aid)

    sv_clean_objs() / do_clean_objs(),do_clean_named_objs(),
		      do_clean_named_io_objs(),do_curse()
			Attempt to free all objects pointed to by RVs,
			try to do the same for all objects indir-
			ectly referenced by typeglobs too, and
			then do a final sweep, cursing any
			objects that remain.  Called once from
			perl_destruct(), prior to calling sv_clean_all()
			below.

    sv_clean_all() / do_clean_all()
			SvREFCNT_dec(sv) each remaining SV, possibly
			triggering an sv_free(). It also sets the
			SVf_BREAK flag on the SV to indicate that the
			refcnt has been artificially lowered, and thus
			stopping sv_free() from giving spurious warnings
			about SVs which unexpectedly have a refcnt
			of zero.  called repeatedly from perl_destruct()
			until there are no SVs left.</code></pre>

<h2 id="Arena-allocator-API-Summary"><a class="permalink" href="perlapi.html#Arena-allocator-API-Summary">#</a><a id="Arena"></a>Arena allocator API Summary</h2>

<p>Private API to rest of sv.c</p>

<pre><code class="plaintext">new_SV(),  del_SV(),

new_XPVNV(), del_XPVGV(),
etc</code></pre>

<p>Public API:</p>

<pre><code class="plaintext">sv_report_used(), sv_clean_objs(), sv_clean_all(), sv_free_arenas()</code></pre>

<dl>

<dt id="boolSV"><a class="permalink" href="perlapi.html#boolSV">#</a><code>boolSV</code> </dt>
<dd>

<p>Returns a true SV if <code>b</code> is a true value, or a false SV if <code>b</code> is 0.</p>

<p>See also <code><a href="perlapi.html#PL_sv_yes">&quot;PL_sv_yes&quot;</a></code> and <code><a href="perlapi.html#PL_sv_no">&quot;PL_sv_no&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV *  boolSV(bool b)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="croak_xs_usage"><a class="permalink" href="perlapi.html#croak_xs_usage">#</a><code>croak_xs_usage</code> </dt>
<dd>

<p>A specialised variant of <code>croak()</code> for emitting the usage message for xsubs</p>

<pre><code>croak_xs_usage(cv, &quot;eee_yow&quot;);</code></pre>

<p>works out the package name and subroutine name from <code>cv</code>, and then calls <code>croak()</code>. Hence if <code>cv</code> is <code>&amp;ouch::awk</code>, it would call <code>croak</code> as:</p>

<pre><code>Perl_croak(aTHX_ &quot;Usage: %&quot; SVf &quot;::%&quot; SVf &quot;(%s)&quot;, &quot;ouch&quot; &quot;awk&quot;,
                                                    &quot;eee_yow&quot;);</code></pre>

<ul>

<pre><code class="plaintext">void  croak_xs_usage(const CV *const cv, const char *const params)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="DEFSV"><a class="permalink" href="perlapi.html#DEFSV">#</a><code>DEFSV</code> </dt>
<dd>

<p>Returns the SV associated with <code>$_</code></p>

<ul>

<pre><code class="plaintext">SV *  DEFSV</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="DEFSV_set"><a class="permalink" href="perlapi.html#DEFSV_set">#</a><code>DEFSV_set</code> </dt>
<dd>

<p>Associate <code>sv</code> with <code>$_</code></p>

<ul>

<pre><code class="plaintext">void  DEFSV_set(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="get_sv"><a class="permalink" href="perlapi.html#get_sv">#</a><code>get_sv</code> </dt>
<dd>

<p>Returns the SV of the specified Perl scalar. <code>flags</code> are passed to <code>gv_fetchpv</code>. If <code>GV_ADD</code> is set and the Perl variable does not exist then it will be created. If <code>flags</code> is zero and the variable does not exist then NULL is returned.</p>

<p>NOTE: the <code>perl_get_sv()</code> form is <b>deprecated</b>.</p>

<ul>

<pre><code class="plaintext">SV*  get_sv(const char *name, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isGV_with_GP"><a class="permalink" href="perlapi.html#isGV_with_GP">#</a><code>isGV_with_GP</code> </dt>
<dd>

<p>Returns a boolean as to whether or not <code>sv</code> is a GV with a pointer to a GP (glob pointer).</p>

<ul>

<pre><code class="plaintext">bool  isGV_with_GP(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="looks_like_number"><a class="permalink" href="perlapi.html#looks_like_number">#</a><code>looks_like_number</code> </dt>
<dd>

<p>Test if the content of an SV looks like a number (or is a number). <code>Inf</code> and <code>Infinity</code> are treated as numbers (so will not issue a non-numeric warning), even if your <code>atof()</code> doesn&#39;t grok them. Get-magic is ignored.</p>

<ul>

<pre><code class="plaintext">I32  looks_like_number(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="MUTABLE_PTR"><a class="permalink" href="perlapi.html#MUTABLE_PTR">#</a><code>MUTABLE_PTR</code></dt>
<dd>

</dd>
<dt id="MUTABLE_AV"><a class="permalink" href="perlapi.html#MUTABLE_AV">#</a><code>MUTABLE_AV</code></dt>
<dd>

</dd>
<dt id="MUTABLE_CV"><a class="permalink" href="perlapi.html#MUTABLE_CV">#</a><code>MUTABLE_CV</code></dt>
<dd>

</dd>
<dt id="MUTABLE_GV"><a class="permalink" href="perlapi.html#MUTABLE_GV">#</a><code>MUTABLE_GV</code></dt>
<dd>

</dd>
<dt id="MUTABLE_HV"><a class="permalink" href="perlapi.html#MUTABLE_HV">#</a><code>MUTABLE_HV</code></dt>
<dd>

</dd>
<dt id="MUTABLE_IO"><a class="permalink" href="perlapi.html#MUTABLE_IO">#</a><code>MUTABLE_IO</code></dt>
<dd>

</dd>
<dt id="MUTABLE_SV"><a class="permalink" href="perlapi.html#MUTABLE_SV">#</a><code>MUTABLE_SV</code> </dt>
<dd>

<p>The <code>MUTABLE_<i>*</i></code>() macros cast pointers to the types shown, in such a way (compiler permitting) that casting away const-ness will give a warning; e.g.:</p>

<pre><code>const SV *sv = ...;
AV *av1 = (AV*)sv;        &lt;== BAD:  the const has been silently
                                    cast away
AV *av2 = MUTABLE_AV(sv); &lt;== GOOD: it may warn</code></pre>

<p><code>MUTABLE_PTR</code> is the base macro used to derive new casts. The other already-built-in ones return pointers to what their names indicate.</p>

<ul>

<pre><code class="plaintext">void *  MUTABLE_PTR(void * p)
AV *    MUTABLE_AV (AV * p)
CV *    MUTABLE_CV (CV * p)
GV *    MUTABLE_GV (GV * p)
HV *    MUTABLE_HV (HV * p)
IO *    MUTABLE_IO (IO * p)
SV *    MUTABLE_SV (SV * p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newRV"><a class="permalink" href="perlapi.html#newRV">#</a><code>newRV</code></dt>
<dd>

</dd>
<dt id="newRV_inc"><a class="permalink" href="perlapi.html#newRV_inc">#</a><code>newRV_inc</code> </dt>
<dd>

<p>These are identical. They create an RV wrapper for an SV. The reference count for the original SV is incremented.</p>

<ul>

<pre><code class="plaintext">SV*  newRV(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newRV_noinc"><a class="permalink" href="perlapi.html#newRV_noinc">#</a><code>newRV_noinc</code> </dt>
<dd>

<p>Creates an RV wrapper for an SV. The reference count for the original SV is <b>not</b> incremented.</p>

<ul>

<pre><code class="plaintext">SV*  newRV_noinc(SV *const tmpRef)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSV"><a class="permalink" href="perlapi.html#newSV">#</a><code>newSV</code> </dt>
<dd>

<p>Creates a new SV. A non-zero <code>len</code> parameter indicates the number of bytes of preallocated string space the SV should have. An extra byte for a trailing <code>NUL</code> is also reserved. (<code>SvPOK</code> is not set for the SV even if string space is allocated.) The reference count for the new SV is set to 1.</p>

<p>In 5.9.3, <code>newSV()</code> replaces the older <code>NEWSV()</code> API, and drops the first parameter, <i>x</i>, a debug aid which allowed callers to identify themselves. This aid has been superseded by a new build option, <code>PERL_MEM_LOG</code> (see <a href="perlhacktips.html#PERL_MEM_LOG">&quot;PERL_MEM_LOG&quot; in perlhacktips</a>). The older API is still there for use in XS modules supporting older perls.</p>

<ul>

<pre><code class="plaintext">SV*  newSV(const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVhek"><a class="permalink" href="perlapi.html#newSVhek">#</a><code>newSVhek</code> </dt>
<dd>

<p>Creates a new SV from the hash key structure. It will generate scalars that point to the shared string table where possible. Returns a new (undefined) SV if <code>hek</code> is NULL.</p>

<ul>

<pre><code class="plaintext">SV*  newSVhek(const HEK *const hek)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSViv"><a class="permalink" href="perlapi.html#newSViv">#</a><code>newSViv</code> </dt>
<dd>

<p>Creates a new SV and copies an integer into it. The reference count for the SV is set to 1.</p>

<ul>

<pre><code class="plaintext">SV*  newSViv(const IV i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVnv"><a class="permalink" href="perlapi.html#newSVnv">#</a><code>newSVnv</code> </dt>
<dd>

<p>Creates a new SV and copies a floating point value into it. The reference count for the SV is set to 1.</p>

<ul>

<pre><code class="plaintext">SV*  newSVnv(const NV n)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpadname"><a class="permalink" href="perlapi.html#newSVpadname">#</a><code>newSVpadname</code> </dt>
<dd>

<p>NOTE: <code>newSVpadname</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Creates a new SV containing the pad name.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpadname(PADNAME *pn)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpv"><a class="permalink" href="perlapi.html#newSVpv">#</a><code>newSVpv</code> </dt>
<dd>

<p>Creates a new SV and copies a string (which may contain <code>NUL</code> (<code>\0</code>) characters) into it. The reference count for the SV is set to 1. If <code>len</code> is zero, Perl will compute the length using <code>strlen()</code>, (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte).</p>

<p>This function can cause reliability issues if you are likely to pass in empty strings that are not null terminated, because it will run strlen on the string and potentially run past valid memory.</p>

<p>Using <a href="perlapi.html#newSVpvn">&quot;newSVpvn&quot;</a> is a safer alternative for non <code>NUL</code> terminated strings. For string literals use <a href="perlapi.html#newSVpvs">&quot;newSVpvs&quot;</a> instead. This function will work fine for <code>NUL</code> terminated strings, but if you want to avoid the if statement on whether to call <code>strlen</code> use <code>newSVpvn</code> instead (calling <code>strlen</code> yourself).</p>

<ul>

<pre><code class="plaintext">SV*  newSVpv(const char *const s, const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvf"><a class="permalink" href="perlapi.html#newSVpvf">#</a><code>newSVpvf</code> </dt>
<dd>

<p>Creates a new SV and initializes it with the string formatted like <code>sv_catpvf</code>.</p>

<p>NOTE: <code>newSVpvf</code> must be explicitly called as <code>Perl_newSVpvf</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">SV*  Perl_newSVpvf(pTHX_ const char *const pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvf_nocontext"><a class="permalink" href="perlapi.html#newSVpvf_nocontext">#</a><code>newSVpvf_nocontext</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#newSVpvf">&quot;newSVpvf&quot;</a></code> but does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvf_nocontext(const char *const pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvn"><a class="permalink" href="perlapi.html#newSVpvn">#</a><code>newSVpvn</code> </dt>
<dd>

<p>Creates a new SV and copies a string into it, which may contain <code>NUL</code> characters (<code>\0</code>) and other binary data. The reference count for the SV is set to 1. Note that if <code>len</code> is zero, Perl will create a zero length (Perl) string. You are responsible for ensuring that the source buffer is at least <code>len</code> bytes long. If the <code>buffer</code> argument is NULL the new SV will be undefined.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvn(const char *const buffer, const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvn_flags"><a class="permalink" href="perlapi.html#newSVpvn_flags">#</a><code>newSVpvn_flags</code> </dt>
<dd>

<p>Creates a new SV and copies a string (which may contain <code>NUL</code> (<code>\0</code>) characters) into it. The reference count for the SV is set to 1. Note that if <code>len</code> is zero, Perl will create a zero length string. You are responsible for ensuring that the source string is at least <code>len</code> bytes long. If the <code>s</code> argument is NULL the new SV will be undefined. Currently the only flag bits accepted are <code>SVf_UTF8</code> and <code>SVs_TEMP</code>. If <code>SVs_TEMP</code> is set, then <code>sv_2mortal()</code> is called on the result before returning. If <code>SVf_UTF8</code> is set, <code>s</code> is considered to be in UTF-8 and the <code>SVf_UTF8</code> flag will be set on the new SV. <code>newSVpvn_utf8()</code> is a convenience wrapper for this function, defined as</p>

<pre><code class="plaintext">    #define newSVpvn_utf8(s, len, u)			\
	newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)</code></pre>

<ul>

<pre><code class="plaintext">SV*  newSVpvn_flags(const char *const s, const STRLEN len,
                    const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvn_share"><a class="permalink" href="perlapi.html#newSVpvn_share">#</a><code>newSVpvn_share</code> </dt>
<dd>

<p>Creates a new SV with its <code>SvPVX_const</code> pointing to a shared string in the string table. If the string does not already exist in the table, it is created first. Turns on the <code>SvIsCOW</code> flag (or <code>READONLY</code> and <code>FAKE</code> in 5.16 and earlier). If the <code>hash</code> parameter is non-zero, that value is used; otherwise the hash is computed. The string&#39;s hash can later be retrieved from the SV with the <code><a href="perlapi.html#SvSHARED_HASH">&quot;SvSHARED_HASH&quot;</a></code> macro. The idea here is that as the string table is used for shared hash keys these strings will have <code>SvPVX_const == HeKEY</code> and hash lookup will avoid string compare.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvn_share(const char* s, I32 len, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvn_utf8"><a class="permalink" href="perlapi.html#newSVpvn_utf8">#</a><code>newSVpvn_utf8</code> </dt>
<dd>

<p>Creates a new SV and copies a string (which may contain <code>NUL</code> (<code>\0</code>) characters) into it. If <code>utf8</code> is true, calls <code>SvUTF8_on</code> on the new SV. Implemented as a wrapper around <code>newSVpvn_flags</code>.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvn_utf8(const char* s, STRLEN len, U32 utf8)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvs"><a class="permalink" href="perlapi.html#newSVpvs">#</a><code>newSVpvs</code> </dt>
<dd>

<p>Like <code>newSVpvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvs(&quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvs_flags"><a class="permalink" href="perlapi.html#newSVpvs_flags">#</a><code>newSVpvs_flags</code> </dt>
<dd>

<p>Like <code>newSVpvn_flags</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvs_flags(&quot;literal string&quot;, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpv_share"><a class="permalink" href="perlapi.html#newSVpv_share">#</a><code>newSVpv_share</code> </dt>
<dd>

<p>Like <code>newSVpvn_share</code>, but takes a <code>NUL</code>-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpv_share(const char* s, U32 hash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVpvs_share"><a class="permalink" href="perlapi.html#newSVpvs_share">#</a><code>newSVpvs_share</code> </dt>
<dd>

<p>Like <code>newSVpvn_share</code>, but takes a literal string instead of a string/length pair and omits the hash parameter.</p>

<ul>

<pre><code class="plaintext">SV*  newSVpvs_share(&quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVrv"><a class="permalink" href="perlapi.html#newSVrv">#</a><code>newSVrv</code> </dt>
<dd>

<p>Creates a new SV for the existing RV, <code>rv</code>, to point to. If <code>rv</code> is not an RV then it will be upgraded to one. If <code>classname</code> is non-null then the new SV will be blessed in the specified package. The new SV is returned and its reference count is 1. The reference count 1 is owned by <code>rv</code>. See also newRV_inc() and newRV_noinc() for creating a new RV properly.</p>

<ul>

<pre><code class="plaintext">SV*  newSVrv(SV *const rv, const char *const classname)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVsv"><a class="permalink" href="perlapi.html#newSVsv">#</a><code>newSVsv</code></dt>
<dd>

</dd>
<dt id="newSVsv_nomg"><a class="permalink" href="perlapi.html#newSVsv_nomg">#</a><code>newSVsv_nomg</code></dt>
<dd>

</dd>
<dt id="newSVsv_flags"><a class="permalink" href="perlapi.html#newSVsv_flags">#</a><code>newSVsv_flags</code> </dt>
<dd>

<p>These create a new SV which is an exact duplicate of the original SV (using <code>sv_setsv</code>.)</p>

<p>They differ only in that <code>newSVsv</code> performs &#39;get&#39; magic; <code>newSVsv_nomg</code> skips any magic; and <code>newSVsv_flags</code> allows you to explicitly set a <code>flags</code> parameter.</p>

<ul>

<pre><code class="plaintext">SV*  newSVsv      (SV *const old)
SV*  newSVsv_nomg (SV *const old)
SV*  newSVsv_flags(SV *const old, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSV_type"><a class="permalink" href="perlapi.html#newSV_type">#</a><code>newSV_type</code> </dt>
<dd>

<p>Creates a new SV, of the type specified. The reference count for the new SV is set to 1.</p>

<ul>

<pre><code class="plaintext">SV*  newSV_type(const svtype type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="newSVuv"><a class="permalink" href="perlapi.html#newSVuv">#</a><code>newSVuv</code> </dt>
<dd>

<p>Creates a new SV and copies an unsigned integer into it. The reference count for the SV is set to 1.</p>

<ul>

<pre><code class="plaintext">SV*  newSVuv(const UV u)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Nullsv"><a class="permalink" href="perlapi.html#Nullsv">#</a><code>Nullsv</code> </dt>
<dd>

<p>Null SV pointer. (No longer available when <code>PERL_CORE</code> is defined.)</p>

</dd>
</dl>

<dl>

<dt id="PL_na"><a class="permalink" href="perlapi.html#PL_na">#</a><code>PL_na</code> </dt>
<dd>

<p>A convenience variable which is typically used with <code>SvPV</code> when one doesn&#39;t care about the length of the string. It is usually more efficient to either declare a local variable and use that instead or to use the <code>SvPV_nolen</code> macro.</p>

<ul>

<pre><code class="plaintext">STRLEN  PL_na</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_sv_no"><a class="permalink" href="perlapi.html#PL_sv_no">#</a><code>PL_sv_no</code> </dt>
<dd>

<p>This is the <code>false</code> SV. It is readonly. See <code><a href="perlapi.html#PL_sv_yes">&quot;PL_sv_yes&quot;</a></code>. Always refer to this as <code>&amp;PL_sv_no</code>.</p>

<ul>

<pre><code class="plaintext">SV  PL_sv_no</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_sv_undef"><a class="permalink" href="perlapi.html#PL_sv_undef">#</a><code>PL_sv_undef</code> </dt>
<dd>

<p>This is the <code>undef</code> SV. It is readonly. Always refer to this as <code>&amp;PL_sv_undef</code>.</p>

<ul>

<pre><code class="plaintext">SV  PL_sv_undef</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_sv_yes"><a class="permalink" href="perlapi.html#PL_sv_yes">#</a><code>PL_sv_yes</code> </dt>
<dd>

<p>This is the <code>true</code> SV. It is readonly. See <code><a href="perlapi.html#PL_sv_no">&quot;PL_sv_no&quot;</a></code>. Always refer to this as <code>&amp;PL_sv_yes</code>.</p>

<ul>

<pre><code class="plaintext">SV  PL_sv_yes</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_sv_zero"><a class="permalink" href="perlapi.html#PL_sv_zero">#</a><code>PL_sv_zero</code> </dt>
<dd>

<p>This readonly SV has a zero numeric value and a <code>&quot;0&quot;</code> string value. It&#39;s similar to <code><a href="perlapi.html#PL_sv_no">&quot;PL_sv_no&quot;</a></code> except for its string value. Can be used as a cheap alternative to <code>mXPUSHi(0)</code> for example. Always refer to this as <code>&amp;PL_sv_zero</code>. Introduced in 5.28.</p>

<ul>

<pre><code class="plaintext">SV  PL_sv_zero</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SAVE_DEFSV"><a class="permalink" href="perlapi.html#SAVE_DEFSV">#</a><code>SAVE_DEFSV</code> </dt>
<dd>

<p>Localize <code>$_</code>. See <a href="perlguts.html#Localizing-changes">&quot;Localizing changes&quot; in perlguts</a>.</p>

<ul>

<pre><code class="plaintext">void  SAVE_DEFSV</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sortsv"><a class="permalink" href="perlapi.html#sortsv">#</a><code>sortsv</code> </dt>
<dd>

<p>In-place sort an array of SV pointers with the given comparison routine.</p>

<p>Currently this always uses mergesort. See <code><a href="perlapi.html#sortsv_flags">&quot;sortsv_flags&quot;</a></code> for a more flexible routine.</p>

<ul>

<pre><code class="plaintext">void  sortsv(SV** array, size_t num_elts, SVCOMPARE_t cmp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sortsv_flags"><a class="permalink" href="perlapi.html#sortsv_flags">#</a><code>sortsv_flags</code> </dt>
<dd>

<p>In-place sort an array of SV pointers with the given comparison routine, with various SORTf_* flag options.</p>

<ul>

<pre><code class="plaintext">void  sortsv_flags(SV** array, size_t num_elts, SVCOMPARE_t cmp,
                   U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SV"><a class="permalink" href="perlapi.html#SV">#</a><code>SV</code></dt>
<dd>

<p>Described in <a href="perlguts.html">perlguts</a>.</p>

</dd>
</dl>

<dl>

<dt id="sv_2cv"><a class="permalink" href="perlapi.html#sv_2cv">#</a><code>sv_2cv</code> </dt>
<dd>

<p>Using various gambits, try to get a CV from an SV; in addition, try if possible to set <code>*st</code> and <code>*gvp</code> to the stash and GV associated with it. The flags in <code>lref</code> are passed to <code>gv_fetchsv</code>.</p>

<ul>

<pre><code class="plaintext">CV*  sv_2cv(SV* sv, HV **const st, GV **const gvp, const I32 lref)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2io"><a class="permalink" href="perlapi.html#sv_2io">#</a><code>sv_2io</code> </dt>
<dd>

<p>Using various gambits, try to get an IO from an SV: the IO slot if its a GV; or the recursive result if we&#39;re an RV; or the IO slot of the symbol named after the PV if we&#39;re a string.</p>

<p>&#39;Get&#39; magic is ignored on the <code>sv</code> passed in, but will be called on <code>SvRV(sv)</code> if <code>sv</code> is an RV.</p>

<ul>

<pre><code class="plaintext">IO*  sv_2io(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2iv_flags"><a class="permalink" href="perlapi.html#sv_2iv_flags">#</a><code>sv_2iv_flags</code> </dt>
<dd>

<p>Return the integer value of an SV, doing any necessary string conversion. If <code>flags</code> has the <code>SV_GMAGIC</code> bit set, does an <code>mg_get()</code> first. Normally used via the <code>SvIV(sv)</code> and <code>SvIVx(sv)</code> macros.</p>

<ul>

<pre><code class="plaintext">IV  sv_2iv_flags(SV *const sv, const I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2mortal"><a class="permalink" href="perlapi.html#sv_2mortal">#</a><code>sv_2mortal</code> </dt>
<dd>

<p>Marks an existing SV as mortal. The SV will be destroyed &quot;soon&quot;, either by an explicit call to <code>FREETMPS</code>, or by an implicit call at places such as statement boundaries. <code>SvTEMP()</code> is turned on which means that the SV&#39;s string buffer can be &quot;stolen&quot; if this SV is copied. See also <code><a href="perlapi.html#sv_newmortal">&quot;sv_newmortal&quot;</a></code> and <code><a href="perlapi.html#sv_mortalcopy">&quot;sv_mortalcopy&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV*  sv_2mortal(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2nv_flags"><a class="permalink" href="perlapi.html#sv_2nv_flags">#</a><code>sv_2nv_flags</code> </dt>
<dd>

<p>Return the num value of an SV, doing any necessary string or integer conversion. If <code>flags</code> has the <code>SV_GMAGIC</code> bit set, does an <code>mg_get()</code> first. Normally used via the <code>SvNV(sv)</code> and <code>SvNVx(sv)</code> macros.</p>

<ul>

<pre><code class="plaintext">NV  sv_2nv_flags(SV *const sv, const I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2pvbyte"><a class="permalink" href="perlapi.html#sv_2pvbyte">#</a><code>sv_2pvbyte</code> </dt>
<dd>

<p>Returns a pointer to the byte-encoded representation of the SV, and set <code>*lp</code> to its length. If the SV is marked as being encoded as UTF-8, it will downgrade it to a byte string as a side-effect, if possible. If the SV cannot be downgraded, this croaks.</p>

<p>Processes &#39;get&#39; magic.</p>

<p>Usually accessed via the <code>SvPVbyte</code> macro.</p>

<ul>

<pre><code class="plaintext">char*  sv_2pvbyte(SV *sv, STRLEN *const lp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2pvutf8"><a class="permalink" href="perlapi.html#sv_2pvutf8">#</a><code>sv_2pvutf8</code> </dt>
<dd>

<p>Return a pointer to the UTF-8-encoded representation of the SV, and set <code>*lp</code> to its length. May cause the SV to be upgraded to UTF-8 as a side-effect.</p>

<p>Usually accessed via the <code>SvPVutf8</code> macro.</p>

<ul>

<pre><code class="plaintext">char*  sv_2pvutf8(SV *sv, STRLEN *const lp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_2uv_flags"><a class="permalink" href="perlapi.html#sv_2uv_flags">#</a><code>sv_2uv_flags</code> </dt>
<dd>

<p>Return the unsigned integer value of an SV, doing any necessary string conversion. If <code>flags</code> has the <code>SV_GMAGIC</code> bit set, does an <code>mg_get()</code> first. Normally used via the <code>SvUV(sv)</code> and <code>SvUVx(sv)</code> macros.</p>

<ul>

<pre><code class="plaintext">UV  sv_2uv_flags(SV *const sv, const I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_backoff"><a class="permalink" href="perlapi.html#sv_backoff">#</a><code>sv_backoff</code> </dt>
<dd>

<p>Remove any string offset. You should normally use the <code>SvOOK_off</code> macro wrapper instead.</p>

<ul>

<pre><code class="plaintext">void  sv_backoff(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_bless"><a class="permalink" href="perlapi.html#sv_bless">#</a><code>sv_bless</code> </dt>
<dd>

<p>Blesses an SV into a specified package. The SV must be an RV. The package must be designated by its stash (see <code><a href="perlapi.html#gv_stashpv">&quot;gv_stashpv&quot;</a></code>). The reference count of the SV is unaffected.</p>

<ul>

<pre><code class="plaintext">SV*  sv_bless(SV *const sv, HV *const stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpv"><a class="permalink" href="perlapi.html#sv_catpv">#</a><code>sv_catpv</code></dt>
<dd>

</dd>
<dt id="sv_catpv_flags"><a class="permalink" href="perlapi.html#sv_catpv_flags">#</a><code>sv_catpv_flags</code></dt>
<dd>

</dd>
<dt id="sv_catpv_mg"><a class="permalink" href="perlapi.html#sv_catpv_mg">#</a><code>sv_catpv_mg</code></dt>
<dd>

</dd>
<dt id="sv_catpv_nomg"><a class="permalink" href="perlapi.html#sv_catpv_nomg">#</a><code>sv_catpv_nomg</code> </dt>
<dd>

<p>These concatenate the <code>NUL</code>-terminated string <code>sstr</code> onto the end of the string which is in the SV. If the SV has the UTF-8 status set, then the bytes appended should be valid UTF-8.</p>

<p>They differ only in how they handle magic:</p>

<p><code>sv_catpv_mg</code> performs both &#39;get&#39; and &#39;set&#39; magic.</p>

<p><code>sv_catpv</code> performs only &#39;get&#39; magic.</p>

<p><code>sv_catpv_nomg</code> skips all magic.</p>

<p><code>sv_catpv_flags</code> has an extra <code>flags</code> parameter which allows you to specify any combination of magic handling (using <code>SV_GMAGIC</code> and/or <code>SV_SMAGIC</code>), and to also override the UTF-8 handling. By supplying the <code>SV_CATUTF8</code> flag, the appended string is forced to be interpreted as UTF-8; by supplying instead the <code>SV_CATBYTES</code> flag, it will be interpreted as just bytes. Either the SV or the string appended will be upgraded to UTF-8 if necessary.</p>

<ul>

<pre><code class="plaintext">void  sv_catpv      (SV *const dsv, const char* sstr)
void  sv_catpv_flags(SV *dsv, const char *sstr, const I32 flags)
void  sv_catpv_mg   (SV *const dsv, const char *const sstr)
void  sv_catpv_nomg (SV *const dsv, const char* sstr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvf"><a class="permalink" href="perlapi.html#sv_catpvf">#</a><code>sv_catpvf</code></dt>
<dd>

</dd>
<dt id="sv_catpvf_nocontext"><a class="permalink" href="perlapi.html#sv_catpvf_nocontext">#</a><code>sv_catpvf_nocontext</code></dt>
<dd>

</dd>
<dt id="sv_catpvf_mg"><a class="permalink" href="perlapi.html#sv_catpvf_mg">#</a><code>sv_catpvf_mg</code></dt>
<dd>

</dd>
<dt id="sv_catpvf_mg_nocontext"><a class="permalink" href="perlapi.html#sv_catpvf_mg_nocontext">#</a><code>sv_catpvf_mg_nocontext</code> </dt>
<dd>

<p>These process their arguments like <code>sprintf</code>, and append the formatted output to an SV. As with <code>sv_vcatpvfn</code>, argument reordering is not supporte when called with a non-null C-style variable argument list.</p>

<p>If the appended data contains &quot;wide&quot; characters (including, but not limited to, SVs with a UTF-8 PV formatted with <code>%s</code>, and characters &gt;255 formatted with <code>%c</code>), the original SV might get upgraded to UTF-8.</p>

<p>If the original SV was UTF-8, the pattern should be valid UTF-8; if the original SV was bytes, the pattern should be too.</p>

<p>All perform &#39;get&#39; magic, but only <code>sv_catpvf_mg</code> and <code>sv_catpvf_mg_nocontext</code> perform &#39;set&#39; magic.</p>

<p><code>sv_catpvf_nocontext</code> and <code>sv_catpvf_mg_nocontext</code> do not take a thread context (<code>aTHX</code>) parameter, so are used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>NOTE: <code>sv_catpvf</code> must be explicitly called as <code>Perl_sv_catpvf</code> with an <code>aTHX_</code> parameter.</p>

<p>NOTE: <code>sv_catpvf_mg</code> must be explicitly called as <code>Perl_sv_catpvf_mg</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_sv_catpvf        (pTHX_ SV *const sv,
                             const char *const pat, ...)
void  sv_catpvf_nocontext   (SV *const sv, const char *const pat,
                             ...)
void  Perl_sv_catpvf_mg     (pTHX_ SV *const sv,
                             const char *const pat, ...)
void  sv_catpvf_mg_nocontext(SV *const sv, const char *const pat,
                             ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvn"><a class="permalink" href="perlapi.html#sv_catpvn">#</a><code>sv_catpvn</code></dt>
<dd>

</dd>
<dt id="sv_catpvn_flags"><a class="permalink" href="perlapi.html#sv_catpvn_flags">#</a><code>sv_catpvn_flags</code></dt>
<dd>

</dd>
<dt id="sv_catpvn_mg"><a class="permalink" href="perlapi.html#sv_catpvn_mg">#</a><code>sv_catpvn_mg</code></dt>
<dd>

</dd>
<dt id="sv_catpvn_nomg"><a class="permalink" href="perlapi.html#sv_catpvn_nomg">#</a><code>sv_catpvn_nomg</code> </dt>
<dd>

<p>These concatenate the <code>len</code> bytes of the string beginning at <code>ptr</code> onto the end of the string which is in <code>dsv</code>. The caller must make sure <code>ptr</code> contains at least <code>len</code> bytes.</p>

<p>For all but <code>sv_catpvn_flags</code>, the string appended is assumed to be valid UTF-8 if the SV has the UTF-8 status set, and a string of bytes otherwise.</p>

<p>They differ in that:</p>

<p><code>sv_catpvn_mg</code> performs both &#39;get&#39; and &#39;set&#39; magic on <code>dsv</code>.</p>

<p><code>sv_catpvn</code> performs only &#39;get&#39; magic.</p>

<p><code>sv_catpvn_nomg</code> skips all magic.</p>

<p><code>sv_catpvn_flags</code> has an extra <code>flags</code> parameter which allows you to specify any combination of magic handling (using <code>SV_GMAGIC</code> and/or <code>SV_SMAGIC</code>) and to also override the UTF-8 handling. By supplying the <code>SV_CATBYTES</code> flag, the appended string is interpreted as plain bytes; by supplying instead the <code>SV_CATUTF8</code> flag, it will be interpreted as UTF-8, and the <code>dsv</code> will be upgraded to UTF-8 if necessary.</p>

<p><code>sv_catpvn</code>, <code>sv_catpvn_mg</code>, and <code>sv_catpvn_nomg</code> are implemented in terms of <code>sv_catpvn_flags</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_catpvn      (SV *dsv, const char *sstr, STRLEN len)
void  sv_catpvn_flags(SV *const dsv, const char *sstr,
                      const STRLEN len, const I32 flags)
void  sv_catpvn_mg   (SV *dsv, const char *sstr, STRLEN len)
void  sv_catpvn_nomg (SV *dsv, const char *sstr, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvs"><a class="permalink" href="perlapi.html#sv_catpvs">#</a><code>sv_catpvs</code> </dt>
<dd>

<p>Like <code>sv_catpvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_catpvs(SV* sv, &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvs_flags"><a class="permalink" href="perlapi.html#sv_catpvs_flags">#</a><code>sv_catpvs_flags</code> </dt>
<dd>

<p>Like <code>sv_catpvn_flags</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_catpvs_flags(SV* sv, &quot;literal string&quot;, I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvs_mg"><a class="permalink" href="perlapi.html#sv_catpvs_mg">#</a><code>sv_catpvs_mg</code> </dt>
<dd>

<p>Like <code>sv_catpvn_mg</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_catpvs_mg(SV* sv, &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catpvs_nomg"><a class="permalink" href="perlapi.html#sv_catpvs_nomg">#</a><code>sv_catpvs_nomg</code> </dt>
<dd>

<p>Like <code>sv_catpvn_nomg</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_catpvs_nomg(SV* sv, &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_catsv"><a class="permalink" href="perlapi.html#sv_catsv">#</a><code>sv_catsv</code></dt>
<dd>

</dd>
<dt id="sv_catsv_flags"><a class="permalink" href="perlapi.html#sv_catsv_flags">#</a><code>sv_catsv_flags</code></dt>
<dd>

</dd>
<dt id="sv_catsv_mg"><a class="permalink" href="perlapi.html#sv_catsv_mg">#</a><code>sv_catsv_mg</code></dt>
<dd>

</dd>
<dt id="sv_catsv_nomg"><a class="permalink" href="perlapi.html#sv_catsv_nomg">#</a><code>sv_catsv_nomg</code> </dt>
<dd>

<p>These concatenate the string from SV <code>sstr</code> onto the end of the string in SV <code>dsv</code>. If <code>sstr</code> is null, these are no-ops; otherwise only <code>dsv</code> is modified.</p>

<p>They differ only in what magic they perform:</p>

<p><code>sv_catsv_mg</code> performs &#39;get&#39; magic on both SVs before the copy, and &#39;set&#39; magic on <code>dsv</code> afterwards.</p>

<p><code>sv_catsv</code> performs just &#39;get&#39; magic, on both SVs.</p>

<p><code>sv_catsv_nomg</code> skips all magic.</p>

<p><code>sv_catsv_flags</code> has an extra <code>flags</code> parameter which allows you to use <code>SV_GMAGIC</code> and/or <code>SV_SMAGIC</code> to specify any combination of magic handling (although either both or neither SV will have &#39;get&#39; magic applied to it.)</p>

<p><code>sv_catsv</code>, <code>sv_catsv_mg</code>, and <code>sv_catsv_nomg</code> are implemented in terms of <code>sv_catsv_flags</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_catsv      (SV *dsv, SV *sstr)
void  sv_catsv_flags(SV *const dsv, SV *const sstr,
                     const I32 flags)
void  sv_catsv_mg   (SV *dsv, SV *sstr)
void  sv_catsv_nomg (SV *dsv, SV *sstr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_chop"><a class="permalink" href="perlapi.html#sv_chop">#</a><code>sv_chop</code> </dt>
<dd>

<p>Efficient removal of characters from the beginning of the string buffer. <code>SvPOK(sv)</code>, or at least <code>SvPOKp(sv)</code>, must be true and <code>ptr</code> must be a pointer to somewhere inside the string buffer. <code>ptr</code> becomes the first character of the adjusted string. Uses the <code>OOK</code> hack. On return, only <code>SvPOK(sv)</code> and <code>SvPOKp(sv)</code> among the <code>OK</code> flags will be true.</p>

<p>Beware: after this function returns, <code>ptr</code> and SvPVX_const(sv) may no longer refer to the same chunk of data.</p>

<p>The unfortunate similarity of this function&#39;s name to that of Perl&#39;s <code>chop</code> operator is strictly coincidental. This function works from the left; <code>chop</code> works from the right.</p>

<ul>

<pre><code class="plaintext">void  sv_chop(SV *const sv, const char *const ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_clear"><a class="permalink" href="perlapi.html#sv_clear">#</a><code>sv_clear</code> </dt>
<dd>

<p>Clear an SV: call any destructors, free up any memory used by the body, and free the body itself. The SV&#39;s head is <i>not</i> freed, although its type is set to all 1&#39;s so that it won&#39;t inadvertently be assumed to be live during global destruction etc. This function should only be called when <code>REFCNT</code> is zero. Most of the time you&#39;ll want to call <code>sv_free()</code> (or its macro wrapper <code>SvREFCNT_dec</code>) instead.</p>

<ul>

<pre><code class="plaintext">void  sv_clear(SV *const orig_sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_cmp"><a class="permalink" href="perlapi.html#sv_cmp">#</a><code>sv_cmp</code> </dt>
<dd>

<p>Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the string in <code>sv1</code> is less than, equal to, or greater than the string in <code>sv2</code>. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware, handles get magic, and will coerce its args to strings if necessary. See also <code><a href="perlapi.html#sv_cmp_locale">&quot;sv_cmp_locale&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">I32  sv_cmp(SV *const sv1, SV *const sv2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_cmp_flags"><a class="permalink" href="perlapi.html#sv_cmp_flags">#</a><code>sv_cmp_flags</code> </dt>
<dd>

<p>Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the string in <code>sv1</code> is less than, equal to, or greater than the string in <code>sv2</code>. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware and will coerce its args to strings if necessary. If the flags has the <code>SV_GMAGIC</code> bit set, it handles get magic. See also <code><a href="perlapi.html#sv_cmp_locale_flags">&quot;sv_cmp_locale_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">I32  sv_cmp_flags(SV *const sv1, SV *const sv2, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_cmp_locale"><a class="permalink" href="perlapi.html#sv_cmp_locale">#</a><code>sv_cmp_locale</code> </dt>
<dd>

<p>Compares the strings in two SVs in a locale-aware manner. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware, handles get magic, and will coerce its args to strings if necessary. See also <code><a href="perlapi.html#sv_cmp">&quot;sv_cmp&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">I32  sv_cmp_locale(SV *const sv1, SV *const sv2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_cmp_locale_flags"><a class="permalink" href="perlapi.html#sv_cmp_locale_flags">#</a><code>sv_cmp_locale_flags</code> </dt>
<dd>

<p>Compares the strings in two SVs in a locale-aware manner. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware and will coerce its args to strings if necessary. If the flags contain <code>SV_GMAGIC</code>, it handles get magic. See also <code><a href="perlapi.html#sv_cmp_flags">&quot;sv_cmp_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">I32  sv_cmp_locale_flags(SV *const sv1, SV *const sv2,
                         const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_collxfrm"><a class="permalink" href="perlapi.html#sv_collxfrm">#</a><code>sv_collxfrm</code> </dt>
<dd>

<p>This calls <code>sv_collxfrm_flags</code> with the SV_GMAGIC flag. See <code><a href="perlapi.html#sv_collxfrm_flags">&quot;sv_collxfrm_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  sv_collxfrm(SV *const sv, STRLEN *const nxp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_collxfrm_flags"><a class="permalink" href="perlapi.html#sv_collxfrm_flags">#</a><code>sv_collxfrm_flags</code> </dt>
<dd>

<p>Add Collate Transform magic to an SV if it doesn&#39;t already have it. If the flags contain <code>SV_GMAGIC</code>, it handles get-magic.</p>

<p>Any scalar variable may carry <code>PERL_MAGIC_collxfrm</code> magic that contains the scalar data of the variable, but transformed to such a format that a normal memory comparison can be used to compare the data according to the locale settings.</p>

<ul>

<pre><code class="plaintext">char*  sv_collxfrm_flags(SV *const sv, STRLEN *const nxp,
                         I32 const flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_copypv"><a class="permalink" href="perlapi.html#sv_copypv">#</a><code>sv_copypv</code></dt>
<dd>

</dd>
<dt id="sv_copypv_nomg"><a class="permalink" href="perlapi.html#sv_copypv_nomg">#</a><code>sv_copypv_nomg</code></dt>
<dd>

</dd>
<dt id="sv_copypv_flags"><a class="permalink" href="perlapi.html#sv_copypv_flags">#</a><code>sv_copypv_flags</code> </dt>
<dd>

<p>These copy a stringified representation of the source SV into the destination SV. They automatically perform coercion of numeric values into strings. Guaranteed to preserve the <code>UTF8</code> flag even from overloaded objects. Similar in nature to <code>sv_2pv[_flags]</code> but they operate directly on an SV instead of just the string. Mostly they use <a href="perlintern.html#sv_2pv_flags">&quot;<code>sv_2pv_flags</code>&quot; in perlintern</a> to do the work, except when that would lose the UTF-8&#39;ness of the PV.</p>

<p>The three forms differ only in whether or not they perform &#39;get magic&#39; on <code>sv</code>. <code>sv_copypv_nomg</code> skips &#39;get magic&#39;; <code>sv_copypv</code> performs it; and <code>sv_copypv_flags</code> either performs it (if the <code>SV_GMAGIC</code> bit is set in <code>flags</code>) or doesn&#39;t (if that bit is cleared).</p>

<ul>

<pre><code class="plaintext">void  sv_copypv      (SV *const dsv, SV *const ssv)
void  sv_copypv_nomg (SV *const dsv, SV *const ssv)
void  sv_copypv_flags(SV *const dsv, SV *const ssv,
                      const I32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvCUR"><a class="permalink" href="perlapi.html#SvCUR">#</a><code>SvCUR</code> </dt>
<dd>

<p>Returns the length, in bytes, of the PV inside the SV. Note that this may not match Perl&#39;s <code>length</code>; for that, use <code>sv_len_utf8(sv)</code>. See <code><a href="perlapi.html#SvLEN">&quot;SvLEN&quot;</a></code> also.</p>

<ul>

<pre><code class="plaintext">STRLEN  SvCUR(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvCUR_set"><a class="permalink" href="perlapi.html#SvCUR_set">#</a><code>SvCUR_set</code> </dt>
<dd>

<p>Sets the current length, in bytes, of the C string which is in the SV. See <code><a href="perlapi.html#SvCUR">&quot;SvCUR&quot;</a></code> and <code>SvIV_set</code>&gt;.</p>

<ul>

<pre><code class="plaintext">void  SvCUR_set(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_dec"><a class="permalink" href="perlapi.html#sv_dec">#</a><code>sv_dec</code></dt>
<dd>

</dd>
<dt id="sv_dec_nomg"><a class="permalink" href="perlapi.html#sv_dec_nomg">#</a><code>sv_dec_nomg</code> </dt>
<dd>

<p>These auto-decrement the value in the SV, doing string to numeric conversion if necessary. They both handle operator overloading.</p>

<p>They differ only in that:</p>

<p><code>sv_dec</code> handles &#39;get&#39; magic; <code>sv_dec_nomg</code> skips &#39;get&#39; magic.</p>

<ul>

<pre><code class="plaintext">void  sv_dec(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_derived_from"><a class="permalink" href="perlapi.html#sv_derived_from">#</a><code>sv_derived_from</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#sv_derived_from_pv">&quot;sv_derived_from_pv&quot;</a>, but doesn&#39;t take a <code>flags</code> parameter.</p>

<ul>

<pre><code class="plaintext">bool  sv_derived_from(SV* sv, const char *const name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_derived_from_pv"><a class="permalink" href="perlapi.html#sv_derived_from_pv">#</a><code>sv_derived_from_pv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#sv_derived_from_pvn">&quot;sv_derived_from_pvn&quot;</a>, but takes a nul-terminated string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">bool  sv_derived_from_pv(SV* sv, const char *const name,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_derived_from_pvn"><a class="permalink" href="perlapi.html#sv_derived_from_pvn">#</a><code>sv_derived_from_pvn</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV is derived from the specified class <i>at the C level</i>. To check derivation at the Perl level, call <code>isa()</code> as a normal Perl method.</p>

<p>Currently, the only significant value for <code>flags</code> is SVf_UTF8.</p>

<ul>

<pre><code class="plaintext">bool  sv_derived_from_pvn(SV* sv, const char *const name,
                          const STRLEN len, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_derived_from_sv"><a class="permalink" href="perlapi.html#sv_derived_from_sv">#</a><code>sv_derived_from_sv</code> </dt>
<dd>

<p>Exactly like <a href="perlapi.html#sv_derived_from_pvn">&quot;sv_derived_from_pvn&quot;</a>, but takes the name string in the form of an SV instead of a string/length pair. This is the advised form.</p>

<ul>

<pre><code class="plaintext">bool  sv_derived_from_sv(SV* sv, SV *namesv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_does"><a class="permalink" href="perlapi.html#sv_does">#</a><code>sv_does</code> </dt>
<dd>

<p>Like <a href="perlapi.html#sv_does_pv">&quot;sv_does_pv&quot;</a>, but doesn&#39;t take a <code>flags</code> parameter.</p>

<ul>

<pre><code class="plaintext">bool  sv_does(SV* sv, const char *const name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_does_pv"><a class="permalink" href="perlapi.html#sv_does_pv">#</a><code>sv_does_pv</code> </dt>
<dd>

<p>Like <a href="perlapi.html#sv_does_sv">&quot;sv_does_sv&quot;</a>, but takes a nul-terminated string instead of an SV.</p>

<ul>

<pre><code class="plaintext">bool  sv_does_pv(SV* sv, const char *const name, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_does_pvn"><a class="permalink" href="perlapi.html#sv_does_pvn">#</a><code>sv_does_pvn</code> </dt>
<dd>

<p>Like <a href="perlapi.html#sv_does_sv">&quot;sv_does_sv&quot;</a>, but takes a string/length pair instead of an SV.</p>

<ul>

<pre><code class="plaintext">bool  sv_does_pvn(SV* sv, const char *const name,
                  const STRLEN len, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_does_sv"><a class="permalink" href="perlapi.html#sv_does_sv">#</a><code>sv_does_sv</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV performs a specific, named role. The SV can be a Perl object or the name of a Perl class.</p>

<ul>

<pre><code class="plaintext">bool  sv_does_sv(SV* sv, SV* namesv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvEND"><a class="permalink" href="perlapi.html#SvEND">#</a><code>SvEND</code> </dt>
<dd>

<p>Returns a pointer to the spot just after the last character in the string which is in the SV, where there is usually a trailing <code>NUL</code> character (even though Perl scalars do not strictly require it). See <code><a href="perlapi.html#SvCUR">&quot;SvCUR&quot;</a></code>. Access the character as <code>*(SvEND(sv))</code>.</p>

<p>Warning: If <code>SvCUR</code> is equal to <code>SvLEN</code>, then <code>SvEND</code> points to unallocated memory.</p>

<ul>

<pre><code class="plaintext">char*  SvEND(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_eq"><a class="permalink" href="perlapi.html#sv_eq">#</a><code>sv_eq</code> </dt>
<dd>

<p>Returns a boolean indicating whether the strings in the two SVs are identical. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware, handles get magic, and will coerce its args to strings if necessary.</p>

<ul>

<pre><code class="plaintext">I32  sv_eq(SV* sv1, SV* sv2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_eq_flags"><a class="permalink" href="perlapi.html#sv_eq_flags">#</a><code>sv_eq_flags</code> </dt>
<dd>

<p>Returns a boolean indicating whether the strings in the two SVs are identical. Is UTF-8 and <span style="white-space: nowrap;"><code>&#39;use bytes&#39;</code></span> aware and coerces its args to strings if necessary. If the flags has the <code>SV_GMAGIC</code> bit set, it handles get-magic, too.</p>

<ul>

<pre><code class="plaintext">I32  sv_eq_flags(SV* sv1, SV* sv2, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_force_normal"><a class="permalink" href="perlapi.html#sv_force_normal">#</a><code>sv_force_normal</code> </dt>
<dd>

<p>Undo various types of fakery on an SV: if the PV is a shared string, make a private copy; if we&#39;re a ref, stop refing; if we&#39;re a glob, downgrade to an <code>xpvmg</code>. See also <code><a href="perlapi.html#sv_force_normal_flags">&quot;sv_force_normal_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_force_normal(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_force_normal_flags"><a class="permalink" href="perlapi.html#sv_force_normal_flags">#</a><code>sv_force_normal_flags</code> </dt>
<dd>

<p>Undo various types of fakery on an SV, where fakery means &quot;more than&quot; a string: if the PV is a shared string, make a private copy; if we&#39;re a ref, stop refing; if we&#39;re a glob, downgrade to an <code>xpvmg</code>; if we&#39;re a copy-on-write scalar, this is the on-write time when we do the copy, and is also used locally; if this is a vstring, drop the vstring magic. If <code>SV_COW_DROP_PV</code> is set then a copy-on-write scalar drops its PV buffer (if any) and becomes <code>SvPOK_off</code> rather than making a copy. (Used where this scalar is about to be set to some other value.) In addition, the <code>flags</code> parameter gets passed to <code>sv_unref_flags()</code> when unreffing. <code>sv_force_normal</code> calls this function with flags set to 0.</p>

<p>This function is expected to be used to signal to perl that this SV is about to be written to, and any extra book-keeping needs to be taken care of. Hence, it croaks on read-only values.</p>

<ul>

<pre><code class="plaintext">void  sv_force_normal_flags(SV *const sv, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_free"><a class="permalink" href="perlapi.html#sv_free">#</a><code>sv_free</code> </dt>
<dd>

<p>Decrement an SV&#39;s reference count, and if it drops to zero, call <code>sv_clear</code> to invoke destructors and free up any memory used by the body; finally, deallocating the SV&#39;s head itself. Normally called via a wrapper macro <code>SvREFCNT_dec</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_free(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvGAMAGIC"><a class="permalink" href="perlapi.html#SvGAMAGIC">#</a><code>SvGAMAGIC</code> </dt>
<dd>

<p>Returns true if the SV has get magic or overloading. If either is true then the scalar is active data, and has the potential to return a new value every time it is accessed. Hence you must be careful to only read it once per user logical operation and work with that returned value. If neither is true then the scalar&#39;s value cannot change unless written to.</p>

<ul>

<pre><code class="plaintext">U32  SvGAMAGIC(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvGETMAGIC"><a class="permalink" href="perlapi.html#SvGETMAGIC">#</a><code>SvGETMAGIC</code> </dt>
<dd>

<p>Invokes <code><a href="perlapi.html#mg_get">&quot;mg_get&quot;</a></code> on an SV if it has &#39;get&#39; magic. For example, this will call <code>FETCH</code> on a tied variable. This macro evaluates its argument more than once.</p>

<ul>

<pre><code class="plaintext">void  SvGETMAGIC(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_gets"><a class="permalink" href="perlapi.html#sv_gets">#</a><code>sv_gets</code> </dt>
<dd>

<p>Get a line from the filehandle and store it into the SV, optionally appending to the currently-stored string. If <code>append</code> is not 0, the line is appended to the SV instead of overwriting it. <code>append</code> should be set to the byte offset that the appended string should start at in the SV (typically, <code>SvCUR(sv)</code> is a suitable choice).</p>

<ul>

<pre><code class="plaintext">char*  sv_gets(SV *const sv, PerlIO *const fp, I32 append)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_get_backrefs"><a class="permalink" href="perlapi.html#sv_get_backrefs">#</a><code>sv_get_backrefs</code> </dt>
<dd>

<p>NOTE: <code>sv_get_backrefs</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>If <code>sv</code> is the target of a weak reference then it returns the back references structure associated with the sv; otherwise return <code>NULL</code>.</p>

<p>When returning a non-null result the type of the return is relevant. If it is an AV then the elements of the AV are the weak reference RVs which point at this item. If it is any other type then the item itself is the weak reference.</p>

<p>See also <code>Perl_sv_add_backref()</code>, <code>Perl_sv_del_backref()</code>, <code>Perl_sv_kill_backrefs()</code></p>

<ul>

<pre><code class="plaintext">SV*  sv_get_backrefs(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvGROW"><a class="permalink" href="perlapi.html#SvGROW">#</a><code>SvGROW</code> </dt>
<dd>

<p>Expands the character buffer in the SV so that it has room for the indicated number of bytes (remember to reserve space for an extra trailing <code>NUL</code> character). Calls <code>sv_grow</code> to perform the expansion if necessary. Returns a pointer to the character buffer. SV must be of type &gt;= <code>SVt_PV</code>. One alternative is to call <code>sv_grow</code> if you are not sure of the type of SV.</p>

<p>You might mistakenly think that <code>len</code> is the number of bytes to add to the existing size, but instead it is the total size <code>sv</code> should be.</p>

<ul>

<pre><code class="plaintext">char *  SvGROW(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_inc"><a class="permalink" href="perlapi.html#sv_inc">#</a><code>sv_inc</code></dt>
<dd>

</dd>
<dt id="sv_inc_nomg"><a class="permalink" href="perlapi.html#sv_inc_nomg">#</a><code>sv_inc_nomg</code> </dt>
<dd>

<p>These auto-increment the value in the SV, doing string to numeric conversion if necessary. They both handle operator overloading.</p>

<p>They differ only in that <code>sv_inc</code> performs &#39;get&#39; magic; <code>sv_inc_nomg</code> skips any magic.</p>

<ul>

<pre><code class="plaintext">void  sv_inc(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_insert"><a class="permalink" href="perlapi.html#sv_insert">#</a><code>sv_insert</code> </dt>
<dd>

<p>Inserts and/or replaces a string at the specified offset/length within the SV. Similar to the Perl <code>substr()</code> function, with <code>littlelen</code> bytes starting at <code>little</code> replacing <code>len</code> bytes of the string in <code>bigstr</code> starting at <code>offset</code>. Handles get magic.</p>

<ul>

<pre><code class="plaintext">void  sv_insert(SV *const bigstr, const STRLEN offset,
                const STRLEN len, const char *const little,
                const STRLEN littlelen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_insert_flags"><a class="permalink" href="perlapi.html#sv_insert_flags">#</a><code>sv_insert_flags</code> </dt>
<dd>

<p>Same as <code>sv_insert</code>, but the extra <code>flags</code> are passed to the <code>SvPV_force_flags</code> that applies to <code>bigstr</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_insert_flags(SV *const bigstr, const STRLEN offset,
                      const STRLEN len, const char *little,
                      const STRLEN littlelen, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK"><a class="permalink" href="perlapi.html#SvIOK">#</a><code>SvIOK</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains an integer.</p>

<ul>

<pre><code class="plaintext">U32  SvIOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_notUV"><a class="permalink" href="perlapi.html#SvIOK_notUV">#</a><code>SvIOK_notUV</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV contains a signed integer.</p>

<ul>

<pre><code class="plaintext">bool  SvIOK_notUV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_off"><a class="permalink" href="perlapi.html#SvIOK_off">#</a><code>SvIOK_off</code> </dt>
<dd>

<p>Unsets the IV status of an SV.</p>

<ul>

<pre><code class="plaintext">void  SvIOK_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_on"><a class="permalink" href="perlapi.html#SvIOK_on">#</a><code>SvIOK_on</code> </dt>
<dd>

<p>Tells an SV that it is an integer.</p>

<ul>

<pre><code class="plaintext">void  SvIOK_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_only"><a class="permalink" href="perlapi.html#SvIOK_only">#</a><code>SvIOK_only</code> </dt>
<dd>

<p>Tells an SV that it is an integer and disables all other <code>OK</code> bits.</p>

<ul>

<pre><code class="plaintext">void  SvIOK_only(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_only_UV"><a class="permalink" href="perlapi.html#SvIOK_only_UV">#</a><code>SvIOK_only_UV</code> </dt>
<dd>

<p>Tells an SV that it is an unsigned integer and disables all other <code>OK</code> bits.</p>

<ul>

<pre><code class="plaintext">void  SvIOK_only_UV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOKp"><a class="permalink" href="perlapi.html#SvIOKp">#</a><code>SvIOKp</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains an integer. Checks the <b>private</b> setting. Use <code>SvIOK</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  SvIOKp(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIOK_UV"><a class="permalink" href="perlapi.html#SvIOK_UV">#</a><code>SvIOK_UV</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV contains an integer that must be interpreted as unsigned. A non-negative integer whose value is within the range of both an IV and a UV may be flagged as either <code>SvUOK</code> or <code>SvIOK</code>.</p>

<ul>

<pre><code class="plaintext">bool  SvIOK_UV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_isa"><a class="permalink" href="perlapi.html#sv_isa">#</a><code>sv_isa</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV is blessed into the specified class.</p>

<p>This does not check for subtypes or method overloading. Use <code>sv_isa_sv</code> to verify an inheritance relationship in the same way as the <code>isa</code> operator by respecting any <code>isa()</code> method overloading; or <code>sv_derived_from_sv</code> to test directly on the actual object type.</p>

<ul>

<pre><code class="plaintext">int  sv_isa(SV* sv, const char *const name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_isa_sv"><a class="permalink" href="perlapi.html#sv_isa_sv">#</a><code>sv_isa_sv</code> </dt>
<dd>

<p>NOTE: <code>sv_isa_sv</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Returns a boolean indicating whether the SV is an object reference and is derived from the specified class, respecting any <code>isa()</code> method overloading it may have. Returns false if <code>sv</code> is not a reference to an object, or is not derived from the specified class.</p>

<p>This is the function used to implement the behaviour of the <code>isa</code> operator.</p>

<p>Does not invoke magic on <code>sv</code>.</p>

<p>Not to be confused with the older <code>sv_isa</code> function, which does not use an overloaded <code>isa()</code> method, nor will check subclassing.</p>

<ul>

<pre><code class="plaintext">bool  sv_isa_sv(SV* sv, SV* namesv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIsCOW"><a class="permalink" href="perlapi.html#SvIsCOW">#</a><code>SvIsCOW</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV is Copy-On-Write (either shared hash key scalars, or full Copy On Write scalars if 5.9.0 is configured for COW).</p>

<ul>

<pre><code class="plaintext">U32  SvIsCOW(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIsCOW_shared_hash"><a class="permalink" href="perlapi.html#SvIsCOW_shared_hash">#</a><code>SvIsCOW_shared_hash</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV is Copy-On-Write shared hash key scalar.</p>

<ul>

<pre><code class="plaintext">bool  SvIsCOW_shared_hash(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_isobject"><a class="permalink" href="perlapi.html#sv_isobject">#</a><code>sv_isobject</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV is an RV pointing to a blessed object. If the SV is not an RV, or if the object is not blessed, then this will return false.</p>

<ul>

<pre><code class="plaintext">int  sv_isobject(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIV"><a class="permalink" href="perlapi.html#SvIV">#</a><code>SvIV</code></dt>
<dd>

</dd>
<dt id="SvIVx"><a class="permalink" href="perlapi.html#SvIVx">#</a><code>SvIVx</code></dt>
<dd>

</dd>
<dt id="SvIV_nomg"><a class="permalink" href="perlapi.html#SvIV_nomg">#</a><code>SvIV_nomg</code> </dt>
<dd>

<p>These coerce the given SV to IV and return it. The returned value in many circumstances will get stored in <code>sv</code>&#39;s IV slot, but not in all cases. (Use <code><a href="perlapi.html#sv_setiv">&quot;sv_setiv&quot;</a></code> to make sure it does).</p>

<p><code>SvIVx</code> is different from the others in that it is guaranteed to evaluate <code>sv</code> exactly once; the others may evaluate it multiple times. Only use this form if <code>sv</code> is an expression with side effects, otherwise use the more efficient <code>SvIV</code>.</p>

<p><code>SvIV_nomg</code> is the same as <code>SvIV</code>, but does not perform &#39;get&#39; magic.</p>

<ul>

<pre><code class="plaintext">IV  SvIV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIV_set"><a class="permalink" href="perlapi.html#SvIV_set">#</a><code>SvIV_set</code> </dt>
<dd>

<p>Set the value of the IV pointer in sv to val. It is possible to perform the same function of this macro with an lvalue assignment to <code>SvIVX</code>. With future Perls, however, it will be more efficient to use <code>SvIV_set</code> instead of the lvalue assignment to <code>SvIVX</code>.</p>

<ul>

<pre><code class="plaintext">void  SvIV_set(SV* sv, IV val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvIVX"><a class="permalink" href="perlapi.html#SvIVX">#</a><code>SvIVX</code> </dt>
<dd>

<p>Returns the raw value in the SV&#39;s IV slot, without checks or conversions. Only use when you are sure <code>SvIOK</code> is true. See also <code><a href="perlapi.html#SvIV">&quot;SvIV&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">IV  SvIVX(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvLEN"><a class="permalink" href="perlapi.html#SvLEN">#</a><code>SvLEN</code> </dt>
<dd>

<p>Returns the size of the string buffer in the SV, not including any part attributable to <code>SvOOK</code>. See <code><a href="perlapi.html#SvCUR">&quot;SvCUR&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">STRLEN  SvLEN(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_len"><a class="permalink" href="perlapi.html#sv_len">#</a><code>sv_len</code> </dt>
<dd>

<p>Returns the length of the string in the SV. Handles magic and type coercion and sets the UTF8 flag appropriately. See also <code><a href="perlapi.html#SvCUR">&quot;SvCUR&quot;</a></code>, which gives raw access to the <code>xpv_cur</code> slot.</p>

<ul>

<pre><code class="plaintext">STRLEN  sv_len(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvLEN_set"><a class="permalink" href="perlapi.html#SvLEN_set">#</a><code>SvLEN_set</code> </dt>
<dd>

<p>Set the size of the string buffer for the SV. See <code><a href="perlapi.html#SvLEN">&quot;SvLEN&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvLEN_set(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_len_utf8"><a class="permalink" href="perlapi.html#sv_len_utf8">#</a><code>sv_len_utf8</code> </dt>
<dd>

<p>Returns the number of characters in the string in an SV, counting wide UTF-8 bytes as a single character. Handles magic and type coercion.</p>

<ul>

<pre><code class="plaintext">STRLEN  sv_len_utf8(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvLOCK"><a class="permalink" href="perlapi.html#SvLOCK">#</a><code>SvLOCK</code> </dt>
<dd>

<p>Arranges for a mutual exclusion lock to be obtained on <code>sv</code> if a suitable module has been loaded.</p>

<ul>

<pre><code class="plaintext">void  SvLOCK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_magic"><a class="permalink" href="perlapi.html#sv_magic">#</a><code>sv_magic</code> </dt>
<dd>

<p>Adds magic to an SV. First upgrades <code>sv</code> to type <code>SVt_PVMG</code> if necessary, then adds a new magic item of type <code>how</code> to the head of the magic list.</p>

<p>See <code><a href="perlapi.html#sv_magicext">&quot;sv_magicext&quot;</a></code> (which <code>sv_magic</code> now calls) for a description of the handling of the <code>name</code> and <code>namlen</code> arguments.</p>

<p>You need to use <code>sv_magicext</code> to add magic to <code>SvREADONLY</code> SVs and also to add more than one instance of the same <code>how</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_magic(SV *const sv, SV *const obj, const int how,
               const char *const name, const I32 namlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_magicext"><a class="permalink" href="perlapi.html#sv_magicext">#</a><code>sv_magicext</code> </dt>
<dd>

<p>Adds magic to an SV, upgrading it if necessary. Applies the supplied <code>vtable</code> and returns a pointer to the magic added.</p>

<p>Note that <code>sv_magicext</code> will allow things that <code>sv_magic</code> will not. In particular, you can add magic to <code>SvREADONLY</code> SVs, and add more than one instance of the same <code>how</code>.</p>

<p>If <code>namlen</code> is greater than zero then a <code>savepvn</code> <i>copy</i> of <code>name</code> is stored, if <code>namlen</code> is zero then <code>name</code> is stored as-is and - as another special case - if <code>(name &amp;&amp; namlen == HEf_SVKEY)</code> then <code>name</code> is assumed to contain an SV* and is stored as-is with its <code>REFCNT</code> incremented.</p>

<p>(This is now used as a subroutine by <code>sv_magic</code>.)</p>

<ul>

<pre><code class="plaintext">MAGIC *  sv_magicext(SV *const sv, SV *const obj, const int how,
                     const MGVTBL *const vtbl,
                     const char *const name, const I32 namlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvMAGIC_set"><a class="permalink" href="perlapi.html#SvMAGIC_set">#</a><code>SvMAGIC_set</code> </dt>
<dd>

<p>Set the value of the MAGIC pointer in <code>sv</code> to val. See <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvMAGIC_set(SV* sv, MAGIC* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_mortalcopy"><a class="permalink" href="perlapi.html#sv_mortalcopy">#</a><code>sv_mortalcopy</code> </dt>
<dd>

<p>Creates a new SV which is a copy of the original SV (using <code>sv_setsv</code>). The new SV is marked as mortal. It will be destroyed &quot;soon&quot;, either by an explicit call to <code>FREETMPS</code>, or by an implicit call at places such as statement boundaries. See also <code><a href="perlapi.html#sv_newmortal">&quot;sv_newmortal&quot;</a></code> and <code><a href="perlapi.html#sv_2mortal">&quot;sv_2mortal&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV*  sv_mortalcopy(SV *const oldsv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_mortalcopy_flags"><a class="permalink" href="perlapi.html#sv_mortalcopy_flags">#</a><code>sv_mortalcopy_flags</code> </dt>
<dd>

<p>Like <code>sv_mortalcopy</code>, but the extra <code>flags</code> are passed to the <code>sv_setsv_flags</code>.</p>

<ul>

<pre><code class="plaintext">SV*  sv_mortalcopy_flags(SV *const oldsv, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_newmortal"><a class="permalink" href="perlapi.html#sv_newmortal">#</a><code>sv_newmortal</code> </dt>
<dd>

<p>Creates a new null SV which is mortal. The reference count of the SV is set to 1. It will be destroyed &quot;soon&quot;, either by an explicit call to <code>FREETMPS</code>, or by an implicit call at places such as statement boundaries. See also <code><a href="perlapi.html#sv_mortalcopy">&quot;sv_mortalcopy&quot;</a></code> and <code><a href="perlapi.html#sv_2mortal">&quot;sv_2mortal&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">SV*  sv_newmortal()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNIOK"><a class="permalink" href="perlapi.html#SvNIOK">#</a><code>SvNIOK</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a number, integer or double.</p>

<ul>

<pre><code class="plaintext">U32  SvNIOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNIOK_off"><a class="permalink" href="perlapi.html#SvNIOK_off">#</a><code>SvNIOK_off</code> </dt>
<dd>

<p>Unsets the NV/IV status of an SV.</p>

<ul>

<pre><code class="plaintext">void  SvNIOK_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNIOKp"><a class="permalink" href="perlapi.html#SvNIOKp">#</a><code>SvNIOKp</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a number, integer or double. Checks the <b>private</b> setting. Use <code>SvNIOK</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  SvNIOKp(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNOK"><a class="permalink" href="perlapi.html#SvNOK">#</a><code>SvNOK</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a double.</p>

<ul>

<pre><code class="plaintext">U32  SvNOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNOK_off"><a class="permalink" href="perlapi.html#SvNOK_off">#</a><code>SvNOK_off</code> </dt>
<dd>

<p>Unsets the NV status of an SV.</p>

<ul>

<pre><code class="plaintext">void  SvNOK_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNOK_on"><a class="permalink" href="perlapi.html#SvNOK_on">#</a><code>SvNOK_on</code> </dt>
<dd>

<p>Tells an SV that it is a double.</p>

<ul>

<pre><code class="plaintext">void  SvNOK_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNOK_only"><a class="permalink" href="perlapi.html#SvNOK_only">#</a><code>SvNOK_only</code> </dt>
<dd>

<p>Tells an SV that it is a double and disables all other OK bits.</p>

<ul>

<pre><code class="plaintext">void  SvNOK_only(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNOKp"><a class="permalink" href="perlapi.html#SvNOKp">#</a><code>SvNOKp</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a double. Checks the <b>private</b> setting. Use <code>SvNOK</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  SvNOKp(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_nolocking"><a class="permalink" href="perlapi.html#sv_nolocking">#</a><code>sv_nolocking</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>sv_nolocking</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Dummy routine which &quot;locks&quot; an SV when there is no locking module present. Exists to avoid test for a <code>NULL</code> function pointer and because it could potentially warn under some level of strict-ness.</p>

<p>&quot;Superseded&quot; by <code>sv_nosharing()</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_nolocking(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_nounlocking"><a class="permalink" href="perlapi.html#sv_nounlocking">#</a><code>sv_nounlocking</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>sv_nounlocking</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Dummy routine which &quot;unlocks&quot; an SV when there is no locking module present. Exists to avoid test for a <code>NULL</code> function pointer and because it could potentially warn under some level of strict-ness.</p>

<p>&quot;Superseded&quot; by <code>sv_nosharing()</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_nounlocking(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNV"><a class="permalink" href="perlapi.html#SvNV">#</a><code>SvNV</code></dt>
<dd>

</dd>
<dt id="SvNVx"><a class="permalink" href="perlapi.html#SvNVx">#</a><code>SvNVx</code></dt>
<dd>

</dd>
<dt id="SvNV_nomg"><a class="permalink" href="perlapi.html#SvNV_nomg">#</a><code>SvNV_nomg</code> </dt>
<dd>

<p>These coerce the given SV to NV and return it. The returned value in many circumstances will get stored in <code>sv</code>&#39;s NV slot, but not in all cases. (Use <code><a href="perlapi.html#sv_setnv">&quot;sv_setnv&quot;</a></code> to make sure it does).</p>

<p><code>SvNVx</code> is different from the others in that it is guaranteed to evaluate <code>sv</code> exactly once; the others may evaluate it multiple times. Only use this form if <code>sv</code> is an expression with side effects, otherwise use the more efficient <code>SvNV</code>.</p>

<p><code>SvNV_nomg</code> is the same as <code>SvNV</code>, but does not perform &#39;get&#39; magic.</p>

<ul>

<pre><code class="plaintext">NV  SvNV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNV_set"><a class="permalink" href="perlapi.html#SvNV_set">#</a><code>SvNV_set</code> </dt>
<dd>

<p>Set the value of the NV pointer in <code>sv</code> to val. See <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvNV_set(SV* sv, NV val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvNVX"><a class="permalink" href="perlapi.html#SvNVX">#</a><code>SvNVX</code> </dt>
<dd>

<p>Returns the raw value in the SV&#39;s NV slot, without checks or conversions. Only use when you are sure <code>SvNOK</code> is true. See also <code><a href="perlapi.html#SvNV">&quot;SvNV&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">NV  SvNVX(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvOK"><a class="permalink" href="perlapi.html#SvOK">#</a><code>SvOK</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the value is defined. This is only meaningful for scalars.</p>

<ul>

<pre><code class="plaintext">U32  SvOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvOOK"><a class="permalink" href="perlapi.html#SvOOK">#</a><code>SvOOK</code> </dt>
<dd>

<p>Returns a U32 indicating whether the pointer to the string buffer is offset. This hack is used internally to speed up removal of characters from the beginning of a <code><a href="perlapi.html#SvPV">&quot;SvPV&quot;</a></code>. When <code>SvOOK</code> is true, then the start of the allocated string buffer is actually <code>SvOOK_offset()</code> bytes before <code>SvPVX</code>. This offset used to be stored in <code>SvIVX</code>, but is now stored within the spare part of the buffer.</p>

<ul>

<pre><code class="plaintext">U32  SvOOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvOOK_off"><a class="permalink" href="perlapi.html#SvOOK_off">#</a><code>SvOOK_off</code> </dt>
<dd>

<p>Remove any string offset.</p>

<ul>

<pre><code class="plaintext">void  SvOOK_off(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvOOK_offset"><a class="permalink" href="perlapi.html#SvOOK_offset">#</a><code>SvOOK_offset</code> </dt>
<dd>

<p>Reads into <code>len</code> the offset from <code>SvPVX</code> back to the true start of the allocated buffer, which will be non-zero if <code>sv_chop</code> has been used to efficiently remove characters from start of the buffer. Implemented as a macro, which takes the address of <code>len</code>, which must be of type <code>STRLEN</code>. Evaluates <code>sv</code> more than once. Sets <code>len</code> to 0 if <code>SvOOK(sv)</code> is false.</p>

<ul>

<pre><code class="plaintext">void  SvOOK_offset(SV*sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOK"><a class="permalink" href="perlapi.html#SvPOK">#</a><code>SvPOK</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a character string.</p>

<ul>

<pre><code class="plaintext">U32  SvPOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOK_off"><a class="permalink" href="perlapi.html#SvPOK_off">#</a><code>SvPOK_off</code> </dt>
<dd>

<p>Unsets the PV status of an SV.</p>

<ul>

<pre><code class="plaintext">void  SvPOK_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOK_on"><a class="permalink" href="perlapi.html#SvPOK_on">#</a><code>SvPOK_on</code> </dt>
<dd>

<p>Tells an SV that it is a string.</p>

<ul>

<pre><code class="plaintext">void  SvPOK_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOK_only"><a class="permalink" href="perlapi.html#SvPOK_only">#</a><code>SvPOK_only</code> </dt>
<dd>

<p>Tells an SV that it is a string and disables all other <code>OK</code> bits. Will also turn off the UTF-8 status.</p>

<ul>

<pre><code class="plaintext">void  SvPOK_only(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOK_only_UTF8"><a class="permalink" href="perlapi.html#SvPOK_only_UTF8">#</a><code>SvPOK_only_UTF8</code> </dt>
<dd>

<p>Tells an SV that it is a string and disables all other <code>OK</code> bits, and leaves the UTF-8 status as it was.</p>

<ul>

<pre><code class="plaintext">void  SvPOK_only_UTF8(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPOKp"><a class="permalink" href="perlapi.html#SvPOKp">#</a><code>SvPOKp</code> </dt>
<dd>

<p>Returns a U32 value indicating whether the SV contains a character string. Checks the <b>private</b> setting. Use <code>SvPOK</code> instead.</p>

<ul>

<pre><code class="plaintext">U32  SvPOKp(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_pos_b2u"><a class="permalink" href="perlapi.html#sv_pos_b2u">#</a><code>sv_pos_b2u</code> </dt>
<dd>

<p>Converts the value pointed to by <code>offsetp</code> from a count of bytes from the start of the string, to a count of the equivalent number of UTF-8 chars. Handles magic and type coercion.</p>

<p>Use <code>sv_pos_b2u_flags</code> in preference, which correctly handles strings longer than 2Gb.</p>

<ul>

<pre><code class="plaintext">void  sv_pos_b2u(SV *const sv, I32 *const offsetp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_pos_b2u_flags"><a class="permalink" href="perlapi.html#sv_pos_b2u_flags">#</a><code>sv_pos_b2u_flags</code> </dt>
<dd>

<p>Converts <code>offset</code> from a count of bytes from the start of the string, to a count of the equivalent number of UTF-8 chars. Handles type coercion. <code>flags</code> is passed to <code>SvPV_flags</code>, and usually should be <code>SV_GMAGIC|SV_CONST_RETURN</code> to handle magic.</p>

<ul>

<pre><code class="plaintext">STRLEN  sv_pos_b2u_flags(SV *const sv, STRLEN const offset,
                         U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_pos_u2b"><a class="permalink" href="perlapi.html#sv_pos_u2b">#</a><code>sv_pos_u2b</code> </dt>
<dd>

<p>Converts the value pointed to by <code>offsetp</code> from a count of UTF-8 chars from the start of the string, to a count of the equivalent number of bytes; if <code>lenp</code> is non-zero, it does the same to <code>lenp</code>, but this time starting from the offset, rather than from the start of the string. Handles magic and type coercion.</p>

<p>Use <code>sv_pos_u2b_flags</code> in preference, which correctly handles strings longer than 2Gb.</p>

<ul>

<pre><code class="plaintext">void  sv_pos_u2b(SV *const sv, I32 *const offsetp,
                 I32 *const lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_pos_u2b_flags"><a class="permalink" href="perlapi.html#sv_pos_u2b_flags">#</a><code>sv_pos_u2b_flags</code> </dt>
<dd>

<p>Converts the offset from a count of UTF-8 chars from the start of the string, to a count of the equivalent number of bytes; if <code>lenp</code> is non-zero, it does the same to <code>lenp</code>, but this time starting from <code>offset</code>, rather than from the start of the string. Handles type coercion. <code>flags</code> is passed to <code>SvPV_flags</code>, and usually should be <code>SV_GMAGIC|SV_CONST_RETURN</code> to handle magic.</p>

<ul>

<pre><code class="plaintext">STRLEN  sv_pos_u2b_flags(SV *const sv, STRLEN uoffset,
                         STRLEN *const lenp, U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPV"><a class="permalink" href="perlapi.html#SvPV">#</a><code>SvPV</code></dt>
<dd>

</dd>
<dt id="SvPVx"><a class="permalink" href="perlapi.html#SvPVx">#</a><code>SvPVx</code></dt>
<dd>

</dd>
<dt id="SvPV_nomg"><a class="permalink" href="perlapi.html#SvPV_nomg">#</a><code>SvPV_nomg</code></dt>
<dd>

</dd>
<dt id="SvPV_nolen"><a class="permalink" href="perlapi.html#SvPV_nolen">#</a><code>SvPV_nolen</code></dt>
<dd>

</dd>
<dt id="SvPVx_nolen"><a class="permalink" href="perlapi.html#SvPVx_nolen">#</a><code>SvPVx_nolen</code></dt>
<dd>

</dd>
<dt id="SvPV_nomg_nolen"><a class="permalink" href="perlapi.html#SvPV_nomg_nolen">#</a><code>SvPV_nomg_nolen</code></dt>
<dd>

</dd>
<dt id="SvPV_mutable"><a class="permalink" href="perlapi.html#SvPV_mutable">#</a><code>SvPV_mutable</code></dt>
<dd>

</dd>
<dt id="SvPV_const"><a class="permalink" href="perlapi.html#SvPV_const">#</a><code>SvPV_const</code></dt>
<dd>

</dd>
<dt id="SvPVx_const"><a class="permalink" href="perlapi.html#SvPVx_const">#</a><code>SvPVx_const</code></dt>
<dd>

</dd>
<dt id="SvPV_nolen_const"><a class="permalink" href="perlapi.html#SvPV_nolen_const">#</a><code>SvPV_nolen_const</code></dt>
<dd>

</dd>
<dt id="SvPVx_nolen_const"><a class="permalink" href="perlapi.html#SvPVx_nolen_const">#</a><code>SvPVx_nolen_const</code></dt>
<dd>

</dd>
<dt id="SvPV_nomg_const"><a class="permalink" href="perlapi.html#SvPV_nomg_const">#</a><code>SvPV_nomg_const</code></dt>
<dd>

</dd>
<dt id="SvPV_nomg_const_nolen"><a class="permalink" href="perlapi.html#SvPV_nomg_const_nolen">#</a><code>SvPV_nomg_const_nolen</code></dt>
<dd>

</dd>
<dt id="SvPV_flags"><a class="permalink" href="perlapi.html#SvPV_flags">#</a><code>SvPV_flags</code></dt>
<dd>

</dd>
<dt id="SvPV_flags_const"><a class="permalink" href="perlapi.html#SvPV_flags_const">#</a><code>SvPV_flags_const</code></dt>
<dd>

</dd>
<dt id="SvPV_flags_mutable"><a class="permalink" href="perlapi.html#SvPV_flags_mutable">#</a><code>SvPV_flags_mutable</code></dt>
<dd>

</dd>
<dt id="SvPVbyte"><a class="permalink" href="perlapi.html#SvPVbyte">#</a><code>SvPVbyte</code></dt>
<dd>

</dd>
<dt id="SvPVbyte_nomg"><a class="permalink" href="perlapi.html#SvPVbyte_nomg">#</a><code>SvPVbyte_nomg</code></dt>
<dd>

</dd>
<dt id="SvPVbyte_nolen"><a class="permalink" href="perlapi.html#SvPVbyte_nolen">#</a><code>SvPVbyte_nolen</code></dt>
<dd>

</dd>
<dt id="SvPVbytex_nolen"><a class="permalink" href="perlapi.html#SvPVbytex_nolen">#</a><code>SvPVbytex_nolen</code></dt>
<dd>

</dd>
<dt id="SvPVbytex"><a class="permalink" href="perlapi.html#SvPVbytex">#</a><code>SvPVbytex</code></dt>
<dd>

</dd>
<dt id="SvPVbyte_or_null"><a class="permalink" href="perlapi.html#SvPVbyte_or_null">#</a><code>SvPVbyte_or_null</code></dt>
<dd>

</dd>
<dt id="SvPVbyte_or_null_nomg"><a class="permalink" href="perlapi.html#SvPVbyte_or_null_nomg">#</a><code>SvPVbyte_or_null_nomg</code></dt>
<dd>

</dd>
<dt id="SvPVutf8"><a class="permalink" href="perlapi.html#SvPVutf8">#</a><code>SvPVutf8</code></dt>
<dd>

</dd>
<dt id="SvPVutf8x"><a class="permalink" href="perlapi.html#SvPVutf8x">#</a><code>SvPVutf8x</code></dt>
<dd>

</dd>
<dt id="SvPVutf8_nomg"><a class="permalink" href="perlapi.html#SvPVutf8_nomg">#</a><code>SvPVutf8_nomg</code></dt>
<dd>

</dd>
<dt id="SvPVutf8_nolen"><a class="permalink" href="perlapi.html#SvPVutf8_nolen">#</a><code>SvPVutf8_nolen</code></dt>
<dd>

</dd>
<dt id="SvPVutf8_or_null"><a class="permalink" href="perlapi.html#SvPVutf8_or_null">#</a><code>SvPVutf8_or_null</code></dt>
<dd>

</dd>
<dt id="SvPVutf8_or_null_nomg"><a class="permalink" href="perlapi.html#SvPVutf8_or_null_nomg">#</a><code>SvPVutf8_or_null_nomg</code> </dt>
<dd>

<p>All these return a pointer to the string in <code>sv</code>, or a stringified form of <code>sv</code> if it does not contain a string. The SV may cache the stringified version becoming <code>SvPOK</code>.</p>

<p>This is a very basic and common operation, so there are lots of slightly different versions of it.</p>

<p>Note that there is no guarantee that the return value of <code>SvPV(sv)</code>, for example, is equal to <code>SvPVX(sv)</code>, or that <code>SvPVX(sv)</code> contains valid data, or that successive calls to <code>SvPV(sv)</code> (or another of these forms) will return the same pointer value each time. This is due to the way that things like overloading and Copy-On-Write are handled. In these cases, the return value may point to a temporary buffer or similar. If you absolutely need the <code>SvPVX</code> field to be valid (for example, if you intend to write to it), then see <code><a href="perlapi.html#SvPV_force">&quot;SvPV_force&quot;</a></code>.</p>

<p>The differences between the forms are:</p>

<p>The forms with neither <code>byte</code> nor <code>utf8</code> in their names (e.g., <code>SvPV</code> or <code>SvPV_nolen</code>) can expose the SV&#39;s internal string buffer. If that buffer consists entirely of bytes 0-255 and includes any bytes above 127, then you <b>MUST</b> consult <code>SvUTF8</code> to determine the actual code points the string is meant to contain. Generally speaking, it is probably safer to prefer <code>SvPVbyte</code>, <code>SvPVutf8</code>, and the like. See <a href="perlguts.html#How-do-I-pass-a-Perl-string-to-a-C-library%3F">&quot;How do I pass a Perl string to a C library?&quot; in perlguts</a> for more details.</p>

<p>The forms with <code>flags</code> in their names allow you to use the <code>flags</code> parameter to specify to process &#39;get&#39; magic (by setting the <code>SV_GMAGIC</code> flag) or to skip &#39;get&#39; magic (by clearing it). The other forms process &#39;get&#39; magic, except for the ones with <code>nomg</code> in their names, which skip &#39;get&#39; magic.</p>

<p>The forms that take a <code>len</code> parameter will set that variable to the byte length of the resultant string (these are macros, so don&#39;t use <code>&amp;len</code>).</p>

<p>The forms with <code>nolen</code> in their names indicate they don&#39;t have a <code>len</code> parameter. They should be used only when it is known that the PV is a C string, terminated by a NUL byte, and without intermediate NUL characters; or when you don&#39;t care about its length.</p>

<p>The forms with <code>const</code> in their names return <span style="white-space: nowrap;"><code>const char *</code></span> so that the compiler will hopefully complain if you were to try to modify the contents of the string (unless you cast away const yourself).</p>

<p>The other forms return a mutable pointer so that the string is modifiable by the caller; this is emphasized for the ones with <code>mutable</code> in their names.</p>

<p>The forms whose name ends in <code>x</code> are the same as the corresponding form without the <code>x</code>, but the <code>x</code> form is guaranteed to evaluate <code>sv</code> exactly once, with a slight loss of efficiency. Use this if <code>sv</code> is an expression with side effects.</p>

<p><code>SvPVutf8</code> is like <code>SvPV</code>, but converts <code>sv</code> to UTF-8 first if not already UTF-8. Similiarly, the other forms with <code>utf8</code> in their names correspond to their respective forms without.</p>

<p><code>SvPVutf8_or_null</code> and <code>SvPVutf8_or_null_nomg</code> don&#39;t have corresponding non-<code>utf8</code> forms. Instead they are like <code>SvPVutf8_nomg</code>, but when <code>sv</code> is undef, they return <code>NULL</code>.</p>

<p><code>SvPVbyte</code> is like <code>SvPV</code>, but converts <code>sv</code> to byte representation first if currently encoded as UTF-8. If <code>sv</code> cannot be downgraded from UTF-8, it croaks. Similiarly, the other forms with <code>byte</code> in their names correspond to their respective forms without.</p>

<p><code>SvPVbyte_or_null</code> doesn&#39;t have a corresponding non-<code>byte</code> form. Instead it is like <code>SvPVbyte</code>, but when <code>sv</code> is undef, it returns <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">char*         SvPV                 (SV* sv, STRLEN len)
char*         SvPVx                (SV* sv, STRLEN len)
char*         SvPV_nomg            (SV* sv, STRLEN len)
char*         SvPV_nolen           (SV* sv)
char*         SvPVx_nolen          (SV* sv)
char*         SvPV_nomg_nolen      (SV* sv)
char*         SvPV_mutable         (SV* sv, STRLEN len)
const char*   SvPV_const           (SV* sv, STRLEN len)
const char*   SvPVx_const          (SV* sv, STRLEN len)
const char*   SvPV_nolen_const     (SV* sv)
const char*   SvPVx_nolen_const    (SV* sv)
const char*   SvPV_nomg_const      (SV* sv, STRLEN len)
const char*   SvPV_nomg_const_nolen(SV* sv)
char *        SvPV_flags           (SV * sv, STRLEN len,
                                    U32 flags)
const char *  SvPV_flags_const     (SV * sv, STRLEN len,
                                    U32 flags)
char *        SvPV_flags_mutable   (SV * sv, STRLEN len,
                                    U32 flags)
char*         SvPVbyte             (SV* sv, STRLEN len)
char*         SvPVbyte_nomg        (SV* sv, STRLEN len)
char*         SvPVbyte_nolen       (SV* sv)
char*         SvPVbytex_nolen      (SV* sv)
char*         SvPVbytex            (SV* sv, STRLEN len)
char*         SvPVbyte_or_null     (SV* sv, STRLEN len)
char*         SvPVbyte_or_null_nomg(SV* sv, STRLEN len)
char*         SvPVutf8             (SV* sv, STRLEN len)
char*         SvPVutf8x            (SV* sv, STRLEN len)
char*         SvPVutf8_nomg        (SV* sv, STRLEN len)
char*         SvPVutf8_nolen       (SV* sv)
char*         SvPVutf8_or_null     (SV* sv, STRLEN len)
char*         SvPVutf8_or_null_nomg(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte1"><a class="permalink" href="perlapi.html#SvPVbyte1">#</a><code>SvPVbyte</code> </dt>
<dd>

<p>Like <code>SvPV</code>, but converts <code>sv</code> to byte representation first if necessary. If the SV cannot be downgraded from UTF-8, this croaks.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte_force"><a class="permalink" href="perlapi.html#SvPVbyte_force">#</a><code>SvPVbyte_force</code> </dt>
<dd>

<p>Like <code>SvPV_force</code>, but converts <code>sv</code> to byte representation first if necessary. If the SV cannot be downgraded from UTF-8, this croaks.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte_force(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte_nolen1"><a class="permalink" href="perlapi.html#SvPVbyte_nolen1">#</a><code>SvPVbyte_nolen</code> </dt>
<dd>

<p>Like <code>SvPV_nolen</code>, but converts <code>sv</code> to byte representation first if necessary. If the SV cannot be downgraded from UTF-8, this croaks.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte_nolen(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte_nomg1"><a class="permalink" href="perlapi.html#SvPVbyte_nomg1">#</a><code>SvPVbyte_nomg</code> </dt>
<dd>

<p>Like <code>SvPVbyte</code>, but does not process get magic.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte_nomg(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte_or_null1"><a class="permalink" href="perlapi.html#SvPVbyte_or_null1">#</a><code>SvPVbyte_or_null</code> </dt>
<dd>

<p>Like <code>SvPVbyte</code>, but when <code>sv</code> is undef, returns <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte_or_null(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVbyte_or_null_nomg1"><a class="permalink" href="perlapi.html#SvPVbyte_or_null_nomg1">#</a><code>SvPVbyte_or_null_nomg</code> </dt>
<dd>

<p>Like <code>SvPVbyte_or_null</code>, but does not process get magic.</p>

<ul>

<pre><code class="plaintext">char*  SvPVbyte_or_null_nomg(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVCLEAR"><a class="permalink" href="perlapi.html#SvPVCLEAR">#</a><code>SvPVCLEAR</code> </dt>
<dd>

<p>Ensures that sv is a SVt_PV and that its SvCUR is 0, and that it is properly null terminated. Equivalent to sv_setpvs(&quot;&quot;), but more efficient.</p>

<ul>

<pre><code class="plaintext">char *  SvPVCLEAR(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPV_force"><a class="permalink" href="perlapi.html#SvPV_force">#</a><code>SvPV_force</code></dt>
<dd>

</dd>
<dt id="SvPV_force_nolen"><a class="permalink" href="perlapi.html#SvPV_force_nolen">#</a><code>SvPV_force_nolen</code></dt>
<dd>

</dd>
<dt id="SvPVx_force"><a class="permalink" href="perlapi.html#SvPVx_force">#</a><code>SvPVx_force</code></dt>
<dd>

</dd>
<dt id="SvPV_force_nomg"><a class="permalink" href="perlapi.html#SvPV_force_nomg">#</a><code>SvPV_force_nomg</code></dt>
<dd>

</dd>
<dt id="SvPV_force_nomg_nolen"><a class="permalink" href="perlapi.html#SvPV_force_nomg_nolen">#</a><code>SvPV_force_nomg_nolen</code></dt>
<dd>

</dd>
<dt id="SvPV_force_mutable"><a class="permalink" href="perlapi.html#SvPV_force_mutable">#</a><code>SvPV_force_mutable</code></dt>
<dd>

</dd>
<dt id="SvPV_force_flags"><a class="permalink" href="perlapi.html#SvPV_force_flags">#</a><code>SvPV_force_flags</code></dt>
<dd>

</dd>
<dt id="SvPV_force_flags_nolen"><a class="permalink" href="perlapi.html#SvPV_force_flags_nolen">#</a><code>SvPV_force_flags_nolen</code></dt>
<dd>

</dd>
<dt id="SvPV_force_flags_mutable"><a class="permalink" href="perlapi.html#SvPV_force_flags_mutable">#</a><code>SvPV_force_flags_mutable</code></dt>
<dd>

</dd>
<dt id="SvPVbyte_force1"><a class="permalink" href="perlapi.html#SvPVbyte_force1">#</a><code>SvPVbyte_force</code></dt>
<dd>

</dd>
<dt id="SvPVbytex_force"><a class="permalink" href="perlapi.html#SvPVbytex_force">#</a><code>SvPVbytex_force</code></dt>
<dd>

</dd>
<dt id="SvPVutf8_force"><a class="permalink" href="perlapi.html#SvPVutf8_force">#</a><code>SvPVutf8_force</code></dt>
<dd>

</dd>
<dt id="SvPVutf8x_force"><a class="permalink" href="perlapi.html#SvPVutf8x_force">#</a><code>SvPVutf8x_force</code> </dt>
<dd>

<p>These are like <code><a href="perlapi.html#SvPV">&quot;SvPV&quot;</a></code>, returning the string in the SV, but will force the SV into containing a string (<code><a href="perlapi.html#SvPOK">&quot;SvPOK&quot;</a></code>), and only a string (<code><a href="perlapi.html#SvPOK_only">&quot;SvPOK_only&quot;</a></code>), by hook or by crook. You need to use one of these <code>force</code> routines if you are going to update the <code><a href="perlapi.html#SvPVX">&quot;SvPVX&quot;</a></code> directly.</p>

<p>Note that coercing an arbitrary scalar into a plain PV will potentially strip useful data from it. For example if the SV was <code>SvROK</code>, then the referent will have its reference count decremented, and the SV itself may be converted to an <code>SvPOK</code> scalar with a string buffer containing a value such as <code>&quot;ARRAY(0x1234)&quot;</code>.</p>

<p>The differences between the forms are:</p>

<p>The forms with <code>flags</code> in their names allow you to use the <code>flags</code> parameter to specify to perform &#39;get&#39; magic (by setting the <code>SV_GMAGIC</code> flag) or to skip &#39;get&#39; magic (by clearing it). The other forms do perform &#39;get&#39; magic, except for the ones with <code>nomg</code> in their names, which skip &#39;get&#39; magic.</p>

<p>The forms that take a <code>len</code> parameter will set that variable to the byte length of the resultant string (these are macros, so don&#39;t use <code>&amp;len</code>).</p>

<p>The forms with <code>nolen</code> in their names indicate they don&#39;t have a <code>len</code> parameter. They should be used only when it is known that the PV is a C string, terminated by a NUL byte, and without intermediate NUL characters; or when you don&#39;t care about its length.</p>

<p>The forms with <code>mutable</code> in their names are effectively the same as those without, but the name emphasizes that the string is modifiable by the caller, which it is in all the forms.</p>

<p><code>SvPVutf8_force</code> is like <code>SvPV_force</code>, but converts <code>sv</code> to UTF-8 first if not already UTF-8.</p>

<p><code>SvPVutf8x_force</code> is like <code>SvPVutf8_force</code>, but guarantees to evaluate <code>sv</code> only once; use the more efficient <code>SvPVutf8_force</code> otherwise.</p>

<p><code>SvPVbyte_force</code> is like <code>SvPV_force</code>, but converts <code>sv</code> to byte representation first if currently encoded as UTF-8. If the SV cannot be downgraded from UTF-8, this croaks.</p>

<p><code>SvPVbytex_force</code> is like <code>SvPVbyte_force</code>, but guarantees to evaluate <code>sv</code> only once; use the more efficient <code>SvPVbyte_force</code> otherwise.</p>

<ul>

<pre><code class="plaintext">char*  SvPV_force              (SV* sv, STRLEN len)
char*  SvPV_force_nolen        (SV* sv)
char*  SvPVx_force             (SV* sv, STRLEN len)
char*  SvPV_force_nomg         (SV* sv, STRLEN len)
char*  SvPV_force_nomg_nolen   (SV * sv)
char*  SvPV_force_mutable      (SV * sv, STRLEN len)
char*  SvPV_force_flags        (SV * sv, STRLEN len, U32 flags)
char*  SvPV_force_flags_nolen  (SV * sv, U32 flags)
char*  SvPV_force_flags_mutable(SV * sv, STRLEN len, U32 flags)
char*  SvPVbyte_force          (SV* sv, STRLEN len)
char*  SvPVbytex_force         (SV* sv, STRLEN len)
char*  SvPVutf8_force          (SV* sv, STRLEN len)
char*  SvPVutf8x_force         (SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPV_free"><a class="permalink" href="perlapi.html#SvPV_free">#</a><code>SvPV_free</code> </dt>
<dd>

<p>Frees the PV buffer in <code>sv</code>, leaving things in a precarious state, so should only be used as part of a larger operation</p>

<ul>

<pre><code class="plaintext">void  SvPV_free(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_pvn_force_flags"><a class="permalink" href="perlapi.html#sv_pvn_force_flags">#</a><code>sv_pvn_force_flags</code> </dt>
<dd>

<p>Get a sensible string out of the SV somehow. If <code>flags</code> has the <code>SV_GMAGIC</code> bit set, will <code><a href="perlapi.html#mg_get">&quot;mg_get&quot;</a></code> on <code>sv</code> if appropriate, else not. <code>sv_pvn_force</code> and <code>sv_pvn_force_nomg</code> are implemented in terms of this function. You normally want to use the various wrapper macros instead: see <code><a href="perlapi.html#SvPV_force">&quot;SvPV_force&quot;</a></code> and <code><a href="perlapi.html#SvPV_force_nomg">&quot;SvPV_force_nomg&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  sv_pvn_force_flags(SV *const sv, STRLEN *const lp,
                          const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPV_renew"><a class="permalink" href="perlapi.html#SvPV_renew">#</a><code>SvPV_renew</code> </dt>
<dd>

<p>Low level micro optimization of <code><a href="perlapi.html#SvGROW">&quot;SvGROW&quot;</a></code>. It is generally better to use <code>SvGROW</code> instead. This is because <code>SvPV_renew</code> ignores potential issues that <code>SvGROW</code> handles. <code>sv</code> needs to have a real <code>PV</code> that is unencombered by things like COW. Using <code>SV_CHECK_THINKFIRST</code> or <code>SV_CHECK_THINKFIRST_COW_DROP</code> before calling this should clean it up, but why not just use <code>SvGROW</code> if you&#39;re not sure about the provenance?</p>

<ul>

<pre><code class="plaintext">void  SvPV_renew(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPV_set"><a class="permalink" href="perlapi.html#SvPV_set">#</a><code>SvPV_set</code> </dt>
<dd>

<p>This is probably not what you want to use, you probably wanted <a href="perlapi.html#sv_usepvn_flags">&quot;sv_usepvn_flags&quot;</a> or <a href="perlapi.html#sv_setpvn">&quot;sv_setpvn&quot;</a> or <a href="perlapi.html#sv_setpvs">&quot;sv_setpvs&quot;</a>.</p>

<p>Set the value of the PV pointer in <code>sv</code> to the Perl allocated <code>NUL</code>-terminated string <code>val</code>. See also <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<p>Remember to free the previous PV buffer. There are many things to check. Beware that the existing pointer may be involved in copy-on-write or other mischief, so do <code>SvOOK_off(sv)</code> and use <code>sv_force_normal</code> or <code>SvPV_force</code> (or check the <code>SvIsCOW</code> flag) first to make sure this modification is safe. Then finally, if it is not a COW, call <code><a href="perlapi.html#SvPV_free">&quot;SvPV_free&quot;</a></code> to free the previous PV buffer.</p>

<ul>

<pre><code class="plaintext">void  SvPV_set(SV* sv, char* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf81"><a class="permalink" href="perlapi.html#SvPVutf81">#</a><code>SvPVutf8</code> </dt>
<dd>

<p>Like <code>SvPV</code>, but converts <code>sv</code> to UTF-8 first if necessary.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf8_force1"><a class="permalink" href="perlapi.html#SvPVutf8_force1">#</a><code>SvPVutf8_force</code> </dt>
<dd>

<p>Like <code>SvPV_force</code>, but converts <code>sv</code> to UTF-8 first if necessary.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8_force(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf8_nolen1"><a class="permalink" href="perlapi.html#SvPVutf8_nolen1">#</a><code>SvPVutf8_nolen</code> </dt>
<dd>

<p>Like <code>SvPV_nolen</code>, but converts <code>sv</code> to UTF-8 first if necessary.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8_nolen(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf8_nomg1"><a class="permalink" href="perlapi.html#SvPVutf8_nomg1">#</a><code>SvPVutf8_nomg</code> </dt>
<dd>

<p>Like <code>SvPVutf8</code>, but does not process get magic.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8_nomg(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf8_or_null1"><a class="permalink" href="perlapi.html#SvPVutf8_or_null1">#</a><code>SvPVutf8_or_null</code> </dt>
<dd>

<p>Like <code>SvPVutf8</code>, but when <code>sv</code> is undef, returns <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8_or_null(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVutf8_or_null_nomg1"><a class="permalink" href="perlapi.html#SvPVutf8_or_null_nomg1">#</a><code>SvPVutf8_or_null_nomg</code> </dt>
<dd>

<p>Like <code>SvPVutf8_or_null</code>, but does not process get magic.</p>

<ul>

<pre><code class="plaintext">char*  SvPVutf8_or_null_nomg(SV* sv, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvPVX"><a class="permalink" href="perlapi.html#SvPVX">#</a><code>SvPVX</code></dt>
<dd>

</dd>
<dt id="SvPVXx"><a class="permalink" href="perlapi.html#SvPVXx">#</a><code>SvPVXx</code></dt>
<dd>

</dd>
<dt id="SvPVX_const"><a class="permalink" href="perlapi.html#SvPVX_const">#</a><code>SvPVX_const</code></dt>
<dd>

</dd>
<dt id="SvPVX_mutable"><a class="permalink" href="perlapi.html#SvPVX_mutable">#</a><code>SvPVX_mutable</code> </dt>
<dd>

<p>These return a pointer to the physical string in the SV. The SV must contain a string. Prior to 5.9.3 it is not safe to execute these unless the SV&#39;s type &gt;= <code>SVt_PV</code>.</p>

<p>These are also used to store the name of an autoloaded subroutine in an XS AUTOLOAD routine. See <a href="perlguts.html#Autoloading-with-XSUBs">&quot;Autoloading with XSUBs&quot; in perlguts</a>.</p>

<p><code>SvPVXx</code> is identical to <code>SvPVX</code>.</p>

<p><code>SvPVX_mutable</code> is merely a synonym for <code>SvPVX</code>, but its name emphasizes that the string is modifiable by the caller.</p>

<p><code>SvPVX_const</code> differs in that the return value has been cast so that the compiler will complain if you were to try to modify the contents of the string, (unless you cast away const yourself).</p>

<ul>

<pre><code class="plaintext">char*        SvPVX        (SV* sv)
char*        SvPVXx       (SV* sv)
const char*  SvPVX_const  (SV* sv)
char*        SvPVX_mutable(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREADONLY"><a class="permalink" href="perlapi.html#SvREADONLY">#</a><code>SvREADONLY</code> </dt>
<dd>

<p>Returns true if the argument is readonly, otherwise returns false. Exposed to perl code via Internals::SvREADONLY().</p>

<ul>

<pre><code class="plaintext">U32  SvREADONLY(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREADONLY_off"><a class="permalink" href="perlapi.html#SvREADONLY_off">#</a><code>SvREADONLY_off</code> </dt>
<dd>

<p>Mark an object as not-readonly. Exactly what this mean depends on the object type. Exposed to perl code via Internals::SvREADONLY().</p>

<ul>

<pre><code class="plaintext">U32  SvREADONLY_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREADONLY_on"><a class="permalink" href="perlapi.html#SvREADONLY_on">#</a><code>SvREADONLY_on</code> </dt>
<dd>

<p>Mark an object as readonly. Exactly what this means depends on the object type. Exposed to perl code via Internals::SvREADONLY().</p>

<ul>

<pre><code class="plaintext">U32  SvREADONLY_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_ref"><a class="permalink" href="perlapi.html#sv_ref">#</a><code>sv_ref</code> </dt>
<dd>

<p>Returns a SV describing what the SV passed in is a reference to.</p>

<p>dst can be a SV to be set to the description or NULL, in which case a mortal SV is returned.</p>

<p>If ob is true and the SV is blessed, the description is the class name, otherwise it is the type of the SV, &quot;SCALAR&quot;, &quot;ARRAY&quot; etc.</p>

<ul>

<pre><code class="plaintext">SV*  sv_ref(SV *dst, const SV *const sv, const int ob)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREFCNT"><a class="permalink" href="perlapi.html#SvREFCNT">#</a><code>SvREFCNT</code> </dt>
<dd>

<p>Returns the value of the object&#39;s reference count. Exposed to perl code via Internals::SvREFCNT().</p>

<ul>

<pre><code class="plaintext">U32  SvREFCNT(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREFCNT_dec"><a class="permalink" href="perlapi.html#SvREFCNT_dec">#</a><code>SvREFCNT_dec</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_dec_NN"><a class="permalink" href="perlapi.html#SvREFCNT_dec_NN">#</a><code>SvREFCNT_dec_NN</code> </dt>
<dd>

<p>These decrement the reference count of the given SV.</p>

<p><code>SvREFCNT_dec_NN</code> may only be used when <code>sv</code> is known to not be <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">void  SvREFCNT_dec(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvREFCNT_inc"><a class="permalink" href="perlapi.html#SvREFCNT_inc">#</a><code>SvREFCNT_inc</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_NN"><a class="permalink" href="perlapi.html#SvREFCNT_inc_NN">#</a><code>SvREFCNT_inc_NN</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_void"><a class="permalink" href="perlapi.html#SvREFCNT_inc_void">#</a><code>SvREFCNT_inc_void</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_void_NN"><a class="permalink" href="perlapi.html#SvREFCNT_inc_void_NN">#</a><code>SvREFCNT_inc_void_NN</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_simple"><a class="permalink" href="perlapi.html#SvREFCNT_inc_simple">#</a><code>SvREFCNT_inc_simple</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_simple_NN"><a class="permalink" href="perlapi.html#SvREFCNT_inc_simple_NN">#</a><code>SvREFCNT_inc_simple_NN</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_simple_void"><a class="permalink" href="perlapi.html#SvREFCNT_inc_simple_void">#</a><code>SvREFCNT_inc_simple_void</code></dt>
<dd>

</dd>
<dt id="SvREFCNT_inc_simple_void_NN"><a class="permalink" href="perlapi.html#SvREFCNT_inc_simple_void_NN">#</a><code>SvREFCNT_inc_simple_void_NN</code> </dt>
<dd>

<p>These all increment the reference count of the given SV. The ones without <code>void</code> in their names return the SV.</p>

<p><code>SvREFCNT_inc</code> is the base operation; the rest are optimizations if various input constraints are known to be true; hence, all can be replaced with <code>SvREFCNT_inc</code>.</p>

<p><code>SvREFCNT_inc_NN</code> can only be used if you know <code>sv</code> is not <code>NULL</code>. Since we don&#39;t have to check the NULLness, it&#39;s faster and smaller.</p>

<p><code>SvREFCNT_inc_void</code> can only be used if you don&#39;t need the return value. The macro doesn&#39;t need to return a meaningful value.</p>

<p><code>SvREFCNT_inc_void_NN</code> can only be used if you both don&#39;t need the return value, and you know that <code>sv</code> is not <code>NULL</code>. The macro doesn&#39;t need to return a meaningful value, or check for NULLness, so it&#39;s smaller and faster.</p>

<p><code>SvREFCNT_inc_simple</code> can only be used with expressions without side effects. Since we don&#39;t have to store a temporary value, it&#39;s faster.</p>

<p><code>SvREFCNT_inc_simple_NN</code> can only be used with expressions without side effects and you know <code>sv</code> is not <code>NULL</code>. Since we don&#39;t have to store a temporary value, nor check for NULLness, it&#39;s faster and smaller.</p>

<p><code>SvREFCNT_inc_simple_void</code> can only be used with expressions without side effects and you don&#39;t need the return value.</p>

<p><code>SvREFCNT_inc_simple_void_NN</code> can only be used with expressions without side effects, you don&#39;t need the return value, and you know <code>sv</code> is not <code>NULL</code>.</p>

<ul>

<pre><code class="plaintext">SV *  SvREFCNT_inc               (SV *sv)
SV *  SvREFCNT_inc_NN            (SV *sv)
void  SvREFCNT_inc_void          (SV *sv)
void  SvREFCNT_inc_void_NN       (SV* sv)
SV*   SvREFCNT_inc_simple        (SV* sv)
SV*   SvREFCNT_inc_simple_NN     (SV* sv)
void  SvREFCNT_inc_simple_void   (SV* sv)
void  SvREFCNT_inc_simple_void_NN(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_reftype"><a class="permalink" href="perlapi.html#sv_reftype">#</a><code>sv_reftype</code> </dt>
<dd>

<p>Returns a string describing what the SV is a reference to.</p>

<p>If ob is true and the SV is blessed, the string is the class name, otherwise it is the type of the SV, &quot;SCALAR&quot;, &quot;ARRAY&quot; etc.</p>

<ul>

<pre><code class="plaintext">const char*  sv_reftype(const SV *const sv, const int ob)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_replace"><a class="permalink" href="perlapi.html#sv_replace">#</a><code>sv_replace</code> </dt>
<dd>

<p>Make the first argument a copy of the second, then delete the original. The target SV physically takes over ownership of the body of the source SV and inherits its flags; however, the target keeps any magic it owns, and any magic in the source is discarded. Note that this is a rather specialist SV copying operation; most of the time you&#39;ll want to use <code>sv_setsv</code> or one of its many macro front-ends.</p>

<ul>

<pre><code class="plaintext">void  sv_replace(SV *const sv, SV *const nsv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_report_used"><a class="permalink" href="perlapi.html#sv_report_used">#</a><code>sv_report_used</code> </dt>
<dd>

<p>Dump the contents of all SVs not yet freed (debugging aid).</p>

<ul>

<pre><code class="plaintext">void  sv_report_used()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_reset"><a class="permalink" href="perlapi.html#sv_reset">#</a><code>sv_reset</code> </dt>
<dd>

<p>Underlying implementation for the <code>reset</code> Perl function. Note that the perl-level function is vaguely deprecated.</p>

<ul>

<pre><code class="plaintext">void  sv_reset(const char* s, HV *const stash)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvROK"><a class="permalink" href="perlapi.html#SvROK">#</a><code>SvROK</code> </dt>
<dd>

<p>Tests if the SV is an RV.</p>

<ul>

<pre><code class="plaintext">U32  SvROK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvROK_off"><a class="permalink" href="perlapi.html#SvROK_off">#</a><code>SvROK_off</code> </dt>
<dd>

<p>Unsets the RV status of an SV.</p>

<ul>

<pre><code class="plaintext">void  SvROK_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvROK_on"><a class="permalink" href="perlapi.html#SvROK_on">#</a><code>SvROK_on</code> </dt>
<dd>

<p>Tells an SV that it is an RV.</p>

<ul>

<pre><code class="plaintext">void  SvROK_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvRV"><a class="permalink" href="perlapi.html#SvRV">#</a><code>SvRV</code> </dt>
<dd>

<p>Dereferences an RV to return the SV.</p>

<ul>

<pre><code class="plaintext">SV*  SvRV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvRV_set"><a class="permalink" href="perlapi.html#SvRV_set">#</a><code>SvRV_set</code> </dt>
<dd>

<p>Set the value of the RV pointer in <code>sv</code> to val. See <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvRV_set(SV* sv, SV* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_rvunweaken"><a class="permalink" href="perlapi.html#sv_rvunweaken">#</a><code>sv_rvunweaken</code> </dt>
<dd>

<p>Unweaken a reference: Clear the <code>SvWEAKREF</code> flag on this RV; remove the backreference to this RV from the array of backreferences associated with the target SV, increment the refcount of the target. Silently ignores <code>undef</code> and warns on non-weak references.</p>

<ul>

<pre><code class="plaintext">SV*  sv_rvunweaken(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_rvweaken"><a class="permalink" href="perlapi.html#sv_rvweaken">#</a><code>sv_rvweaken</code> </dt>
<dd>

<p>Weaken a reference: set the <code>SvWEAKREF</code> flag on this RV; give the referred-to SV <code>PERL_MAGIC_backref</code> magic if it hasn&#39;t already; and push a back-reference to this RV onto the array of backreferences associated with that magic. If the RV is magical, set magic will be called after the RV is cleared. Silently ignores <code>undef</code> and warns on already-weak references.</p>

<ul>

<pre><code class="plaintext">SV*  sv_rvweaken(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setiv"><a class="permalink" href="perlapi.html#sv_setiv">#</a><code>sv_setiv</code></dt>
<dd>

</dd>
<dt id="sv_setiv_mg"><a class="permalink" href="perlapi.html#sv_setiv_mg">#</a><code>sv_setiv_mg</code> </dt>
<dd>

<p>These copy an integer into the given SV, upgrading first if necessary.</p>

<p>They differ only in that <code>sv_setiv_mg</code> handles &#39;set&#39; magic; <code>sv_setiv</code> does not.</p>

<ul>

<pre><code class="plaintext">void  sv_setiv   (SV *const sv, const IV num)
void  sv_setiv_mg(SV *const sv, const IV i)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSETMAGIC"><a class="permalink" href="perlapi.html#SvSETMAGIC">#</a><code>SvSETMAGIC</code> </dt>
<dd>

<p>Invokes <code><a href="perlapi.html#mg_set">&quot;mg_set&quot;</a></code> on an SV if it has &#39;set&#39; magic. This is necessary after modifying a scalar, in case it is a magical variable like <code>$|</code> or a tied variable (it calls <code>STORE</code>). This macro evaluates its argument more than once.</p>

<ul>

<pre><code class="plaintext">void  SvSETMAGIC(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setnv"><a class="permalink" href="perlapi.html#sv_setnv">#</a><code>sv_setnv</code></dt>
<dd>

</dd>
<dt id="sv_setnv_mg"><a class="permalink" href="perlapi.html#sv_setnv_mg">#</a><code>sv_setnv_mg</code> </dt>
<dd>

<p>These copy a double into the given SV, upgrading first if necessary.</p>

<p>They differ only in that <code>sv_setnv_mg</code> handles &#39;set&#39; magic; <code>sv_setnv</code> does not.</p>

<ul>

<pre><code class="plaintext">void  sv_setnv(SV *const sv, const NV num)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpv"><a class="permalink" href="perlapi.html#sv_setpv">#</a><code>sv_setpv</code></dt>
<dd>

</dd>
<dt id="sv_setpv_mg"><a class="permalink" href="perlapi.html#sv_setpv_mg">#</a><code>sv_setpv_mg</code> </dt>
<dd>

<p>These copy a string into an SV. The string must be terminated with a <code>NUL</code> character, and not contain embeded <code>NUL</code>&#39;s.</p>

<p>They differ only in that:</p>

<p><code>sv_setpv</code> does not handle &#39;set&#39; magic; <code>sv_setpv_mg</code> does.</p>

<ul>

<pre><code class="plaintext">void  sv_setpv(SV *const sv, const char *const ptr)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpvf"><a class="permalink" href="perlapi.html#sv_setpvf">#</a><code>sv_setpvf</code></dt>
<dd>

</dd>
<dt id="sv_setpvf_nocontext"><a class="permalink" href="perlapi.html#sv_setpvf_nocontext">#</a><code>sv_setpvf_nocontext</code></dt>
<dd>

</dd>
<dt id="sv_setpvf_mg"><a class="permalink" href="perlapi.html#sv_setpvf_mg">#</a><code>sv_setpvf_mg</code></dt>
<dd>

</dd>
<dt id="sv_setpvf_mg_nocontext"><a class="permalink" href="perlapi.html#sv_setpvf_mg_nocontext">#</a><code>sv_setpvf_mg_nocontext</code> </dt>
<dd>

<p>These work like <code><a href="perlapi.html#sv_catpvf">&quot;sv_catpvf&quot;</a></code> but copy the text into the SV instead of appending it.</p>

<p>The differences between these are:</p>

<p><code>sv_setpvf</code> and <code>sv_setpvf_nocontext</code> do not handle &#39;set&#39; magic; <code>sv_setpvf_mg</code> and <code>sv_setpvf_mg_nocontext</code> do.</p>

<p><code>sv_setpvf_nocontext</code> and <code>sv_setpvf_mg_nocontext</code> do not take a thread context (<code>aTHX</code>) parameter, so are used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>NOTE: <code>sv_setpvf</code> must be explicitly called as <code>Perl_sv_setpvf</code> with an <code>aTHX_</code> parameter.</p>

<p>NOTE: <code>sv_setpvf_mg</code> must be explicitly called as <code>Perl_sv_setpvf_mg</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_sv_setpvf        (pTHX_ SV *const sv,
                             const char *const pat, ...)
void  sv_setpvf_nocontext   (SV *const sv, const char *const pat,
                             ...)
void  Perl_sv_setpvf_mg     (pTHX_ SV *const sv,
                             const char *const pat, ...)
void  sv_setpvf_mg_nocontext(SV *const sv, const char *const pat,
                             ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpviv"><a class="permalink" href="perlapi.html#sv_setpviv">#</a><code>sv_setpviv</code></dt>
<dd>

</dd>
<dt id="sv_setpviv_mg"><a class="permalink" href="perlapi.html#sv_setpviv_mg">#</a><code>sv_setpviv_mg</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>sv_setpviv</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>sv_setpviv_mg</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>These copy an integer into the given SV, also updating its string value.</p>

<p>They differ only in that <code>sv_setpviv_mg</code> performs &#39;set&#39; magic; <code>sv_setpviv</code> skips any magic.</p>

<ul>

<pre><code class="plaintext">void  sv_setpviv   (SV *const sv, const IV num)
void  sv_setpviv_mg(SV *const sv, const IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpvn"><a class="permalink" href="perlapi.html#sv_setpvn">#</a><code>sv_setpvn</code></dt>
<dd>

</dd>
<dt id="sv_setpvn_mg"><a class="permalink" href="perlapi.html#sv_setpvn_mg">#</a><code>sv_setpvn_mg</code> </dt>
<dd>

<p>These copy a string (possibly containing embedded <code>NUL</code> characters) into an SV. The <code>len</code> parameter indicates the number of bytes to be copied. If the <code>ptr</code> argument is NULL the SV will become undefined.</p>

<p>The UTF-8 flag is not changed by these functions. A terminating NUL byte is guaranteed.</p>

<p>They differ only in that:</p>

<p><code>sv_setpvn</code> does not handle &#39;set&#39; magic; <code>sv_setpvn_mg</code> does.</p>

<ul>

<pre><code class="plaintext">void  sv_setpvn(SV *const sv, const char *const ptr,
                const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpvs"><a class="permalink" href="perlapi.html#sv_setpvs">#</a><code>sv_setpvs</code> </dt>
<dd>

<p>Like <code>sv_setpvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_setpvs(SV* sv, &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpvs_mg"><a class="permalink" href="perlapi.html#sv_setpvs_mg">#</a><code>sv_setpvs_mg</code> </dt>
<dd>

<p>Like <code>sv_setpvn_mg</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">void  sv_setpvs_mg(SV* sv, &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setpv_bufsize"><a class="permalink" href="perlapi.html#sv_setpv_bufsize">#</a><code>sv_setpv_bufsize</code> </dt>
<dd>

<p>Sets the SV to be a string of cur bytes length, with at least len bytes available. Ensures that there is a null byte at SvEND. Returns a char * pointer to the SvPV buffer.</p>

<ul>

<pre><code class="plaintext">char  *  sv_setpv_bufsize(SV *const sv, const STRLEN cur,
                          const STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_iv"><a class="permalink" href="perlapi.html#sv_setref_iv">#</a><code>sv_setref_iv</code> </dt>
<dd>

<p>Copies an integer into a new SV, optionally blessing the SV. The <code>rv</code> argument will be upgraded to an RV. That RV will be modified to point to the new SV. The <code>classname</code> argument indicates the package for the blessing. Set <code>classname</code> to <code>NULL</code> to avoid the blessing. The new SV will have a reference count of 1, and the RV will be returned.</p>

<ul>

<pre><code class="plaintext">SV*  sv_setref_iv(SV *const rv, const char *const classname,
                  const IV iv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_nv"><a class="permalink" href="perlapi.html#sv_setref_nv">#</a><code>sv_setref_nv</code> </dt>
<dd>

<p>Copies a double into a new SV, optionally blessing the SV. The <code>rv</code> argument will be upgraded to an RV. That RV will be modified to point to the new SV. The <code>classname</code> argument indicates the package for the blessing. Set <code>classname</code> to <code>NULL</code> to avoid the blessing. The new SV will have a reference count of 1, and the RV will be returned.</p>

<ul>

<pre><code class="plaintext">SV*  sv_setref_nv(SV *const rv, const char *const classname,
                  const NV nv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_pv"><a class="permalink" href="perlapi.html#sv_setref_pv">#</a><code>sv_setref_pv</code> </dt>
<dd>

<p>Copies a pointer into a new SV, optionally blessing the SV. The <code>rv</code> argument will be upgraded to an RV. That RV will be modified to point to the new SV. If the <code>pv</code> argument is <code>NULL</code>, then <code>PL_sv_undef</code> will be placed into the SV. The <code>classname</code> argument indicates the package for the blessing. Set <code>classname</code> to <code>NULL</code> to avoid the blessing. The new SV will have a reference count of 1, and the RV will be returned.</p>

<p>Do not use with other Perl types such as HV, AV, SV, CV, because those objects will become corrupted by the pointer copy process.</p>

<p>Note that <code>sv_setref_pvn</code> copies the string while this copies the pointer.</p>

<ul>

<pre><code class="plaintext">SV*  sv_setref_pv(SV *const rv, const char *const classname,
                  void *const pv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_pvn"><a class="permalink" href="perlapi.html#sv_setref_pvn">#</a><code>sv_setref_pvn</code> </dt>
<dd>

<p>Copies a string into a new SV, optionally blessing the SV. The length of the string must be specified with <code>n</code>. The <code>rv</code> argument will be upgraded to an RV. That RV will be modified to point to the new SV. The <code>classname</code> argument indicates the package for the blessing. Set <code>classname</code> to <code>NULL</code> to avoid the blessing. The new SV will have a reference count of 1, and the RV will be returned.</p>

<p>Note that <code>sv_setref_pv</code> copies the pointer while this copies the string.</p>

<ul>

<pre><code class="plaintext">SV*  sv_setref_pvn(SV *const rv, const char *const classname,
                   const char *const pv, const STRLEN n)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_pvs"><a class="permalink" href="perlapi.html#sv_setref_pvs">#</a><code>sv_setref_pvs</code> </dt>
<dd>

<p>Like <code>sv_setref_pvn</code>, but takes a literal string instead of a string/length pair.</p>

<ul>

<pre><code class="plaintext">SV *  sv_setref_pvs(SV *const rv, const char *const classname,
                    &quot;literal string&quot;)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setref_uv"><a class="permalink" href="perlapi.html#sv_setref_uv">#</a><code>sv_setref_uv</code> </dt>
<dd>

<p>Copies an unsigned integer into a new SV, optionally blessing the SV. The <code>rv</code> argument will be upgraded to an RV. That RV will be modified to point to the new SV. The <code>classname</code> argument indicates the package for the blessing. Set <code>classname</code> to <code>NULL</code> to avoid the blessing. The new SV will have a reference count of 1, and the RV will be returned.</p>

<ul>

<pre><code class="plaintext">SV*  sv_setref_uv(SV *const rv, const char *const classname,
                  const UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSetSV"><a class="permalink" href="perlapi.html#SvSetSV">#</a><code>SvSetSV</code></dt>
<dd>

</dd>
<dt id="SvSetMagicSV"><a class="permalink" href="perlapi.html#SvSetMagicSV">#</a><code>SvSetMagicSV</code></dt>
<dd>

</dd>
<dt id="SvSetSV_nosteal"><a class="permalink" href="perlapi.html#SvSetSV_nosteal">#</a><code>SvSetSV_nosteal</code></dt>
<dd>

</dd>
<dt id="SvSetMagicSV_nosteal"><a class="permalink" href="perlapi.html#SvSetMagicSV_nosteal">#</a><code>SvSetMagicSV_nosteal</code> </dt>
<dd>

<p>if <code>dsv</code> is the same as <code>ssv</code>, these do nothing. Otherwise they all call some form of <code><a href="perlapi.html#sv_setsv">&quot;sv_setsv&quot;</a></code>. They may evaluate their arguments more than once.</p>

<p>The only differences are:</p>

<p><code>SvSetMagicSV</code> and <code>SvSetMagicSV_nosteal</code> perform any required &#39;set&#39; magic afterwards on the destination SV; <code>SvSetSV</code> and <code>SvSetSV_nosteal</code> do not.</p>

<p><code>SvSetSV_nosteal</code> <code>SvSetMagicSV_nosteal</code> call a non-destructive version of <code>sv_setsv</code>.</p>

<ul>

<pre><code class="plaintext">void  SvSetSV(SV* dsv, SV* ssv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setsv"><a class="permalink" href="perlapi.html#sv_setsv">#</a><code>sv_setsv</code></dt>
<dd>

</dd>
<dt id="sv_setsv_flags"><a class="permalink" href="perlapi.html#sv_setsv_flags">#</a><code>sv_setsv_flags</code></dt>
<dd>

</dd>
<dt id="sv_setsv_mg"><a class="permalink" href="perlapi.html#sv_setsv_mg">#</a><code>sv_setsv_mg</code></dt>
<dd>

</dd>
<dt id="sv_setsv_nomg"><a class="permalink" href="perlapi.html#sv_setsv_nomg">#</a><code>sv_setsv_nomg</code> </dt>
<dd>

<p>These copy the contents of the source SV <code>ssv</code> into the destination SV <code>dsv</code>. <code>ssv</code> may be destroyed if it is mortal, so don&#39;t use these functions if the source SV needs to be reused. Loosely speaking, they perform a copy-by-value, obliterating any previous content of the destination.</p>

<p>They differ only in that:</p>

<p><code>sv_setsv</code> calls &#39;get&#39; magic on <code>ssv</code>, but skips &#39;set&#39; magic on <code>dsv</code>.</p>

<p><code>sv_setsv_mg</code> calls both &#39;get&#39; magic on <code>ssv</code> and &#39;set&#39; magic on <code>dsv</code>.</p>

<p><code>sv_setsv_nomg</code> skips all magic.</p>

<p><code>sv_setsv_flags</code> has a <code>flags</code> parameter which you can use to specify any combination of magic handling, and also you can specify <code>SV_NOSTEAL</code> so that the buffers of temps will not be stolen.</p>

<p>You probably want to instead use one of the assortment of wrappers, such as <code><a href="perlapi.html#SvSetSV">&quot;SvSetSV&quot;</a></code>, <code><a href="perlapi.html#SvSetSV_nosteal">&quot;SvSetSV_nosteal&quot;</a></code>, <code><a href="perlapi.html#SvSetMagicSV">&quot;SvSetMagicSV&quot;</a></code> and <code><a href="perlapi.html#SvSetMagicSV_nosteal">&quot;SvSetMagicSV_nosteal&quot;</a></code>.</p>

<p><code>sv_setsv_flags</code> is the primary function for copying scalars, and most other copy-ish functions and macros use it underneath.</p>

<ul>

<pre><code class="plaintext">void  sv_setsv      (SV *dsv, SV *ssv)
void  sv_setsv_flags(SV *dsv, SV *ssv, const I32 flags)
void  sv_setsv_mg   (SV *const dsv, SV *const ssv)
void  sv_setsv_nomg (SV *dsv, SV *ssv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_setuv"><a class="permalink" href="perlapi.html#sv_setuv">#</a><code>sv_setuv</code></dt>
<dd>

</dd>
<dt id="sv_setuv_mg"><a class="permalink" href="perlapi.html#sv_setuv_mg">#</a><code>sv_setuv_mg</code> </dt>
<dd>

<p>These copy an unsigned integer into the given SV, upgrading first if necessary.</p>

<p>They differ only in that <code>sv_setuv_mg</code> handles &#39;set&#39; magic; <code>sv_setuv</code> does not.</p>

<ul>

<pre><code class="plaintext">void  sv_setuv   (SV *const sv, const UV num)
void  sv_setuv_mg(SV *const sv, const UV u)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_set_undef"><a class="permalink" href="perlapi.html#sv_set_undef">#</a><code>sv_set_undef</code> </dt>
<dd>

<p>Equivalent to <code>sv_setsv(sv, &amp;PL_sv_undef)</code>, but more efficient. Doesn&#39;t handle set magic.</p>

<p>The perl equivalent is <code>$sv = undef;</code>. Note that it doesn&#39;t free any string buffer, unlike <code>undef $sv</code>.</p>

<p>Introduced in perl 5.25.12.</p>

<ul>

<pre><code class="plaintext">void  sv_set_undef(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSHARE"><a class="permalink" href="perlapi.html#SvSHARE">#</a><code>SvSHARE</code> </dt>
<dd>

<p>Arranges for <code>sv</code> to be shared between threads if a suitable module has been loaded.</p>

<ul>

<pre><code class="plaintext">void  SvSHARE(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSHARED_HASH"><a class="permalink" href="perlapi.html#SvSHARED_HASH">#</a><code>SvSHARED_HASH</code> </dt>
<dd>

<p>Returns the hash for <code>sv</code> created by <code><a href="perlapi.html#newSVpvn_share">&quot;newSVpvn_share&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">struct hek*  SvSHARED_HASH(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSTASH"><a class="permalink" href="perlapi.html#SvSTASH">#</a><code>SvSTASH</code> </dt>
<dd>

<p>Returns the stash of the SV.</p>

<ul>

<pre><code class="plaintext">HV*  SvSTASH(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvSTASH_set"><a class="permalink" href="perlapi.html#SvSTASH_set">#</a><code>SvSTASH_set</code> </dt>
<dd>

<p>Set the value of the STASH pointer in <code>sv</code> to val. See <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvSTASH_set(SV* sv, HV* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTAINT"><a class="permalink" href="perlapi.html#SvTAINT">#</a><code>SvTAINT</code> </dt>
<dd>

<p>Taints an SV if tainting is enabled, and if some input to the current expression is tainted--usually a variable, but possibly also implicit inputs such as locale settings. <code>SvTAINT</code> propagates that taintedness to the outputs of an expression in a pessimistic fashion; i.e., without paying attention to precisely which outputs are influenced by which inputs.</p>

<ul>

<pre><code class="plaintext">void  SvTAINT(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTAINTED"><a class="permalink" href="perlapi.html#SvTAINTED">#</a><code>SvTAINTED</code> </dt>
<dd>

<p>Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if not.</p>

<ul>

<pre><code class="plaintext">bool  SvTAINTED(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTAINTED_off"><a class="permalink" href="perlapi.html#SvTAINTED_off">#</a><code>SvTAINTED_off</code> </dt>
<dd>

<p>Untaints an SV. Be <i>very</i> careful with this routine, as it short-circuits some of Perl&#39;s fundamental security features. XS module authors should not use this function unless they fully understand all the implications of unconditionally untainting the value. Untainting should be done in the standard perl fashion, via a carefully crafted regexp, rather than directly untainting variables.</p>

<ul>

<pre><code class="plaintext">void  SvTAINTED_off(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTAINTED_on"><a class="permalink" href="perlapi.html#SvTAINTED_on">#</a><code>SvTAINTED_on</code> </dt>
<dd>

<p>Marks an SV as tainted if tainting is enabled.</p>

<ul>

<pre><code class="plaintext">void  SvTAINTED_on(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTRUE"><a class="permalink" href="perlapi.html#SvTRUE">#</a><code>SvTRUE</code></dt>
<dd>

</dd>
<dt id="SvTRUEx"><a class="permalink" href="perlapi.html#SvTRUEx">#</a><code>SvTRUEx</code></dt>
<dd>

</dd>
<dt id="SvTRUE_nomg"><a class="permalink" href="perlapi.html#SvTRUE_nomg">#</a><code>SvTRUE_nomg</code></dt>
<dd>

</dd>
<dt id="SvTRUE_NN"><a class="permalink" href="perlapi.html#SvTRUE_NN">#</a><code>SvTRUE_NN</code></dt>
<dd>

</dd>
<dt id="SvTRUE_nomg_NN"><a class="permalink" href="perlapi.html#SvTRUE_nomg_NN">#</a><code>SvTRUE_nomg_NN</code> </dt>
<dd>

<p>These return a boolean indicating whether Perl would evaluate the SV as true or false. See <code><a href="perlapi.html#SvOK">&quot;SvOK&quot;</a></code> for a defined/undefined test.</p>

<p>As of Perl 5.32, all are guaranteed to evaluate <code>sv</code> only once. Prior to that release, only <code>SvTRUEx</code> guaranteed single evaluation; now <code>SvTRUEx</code> is identical to <code>SvTRUE</code>.</p>

<p><code>SvTRUE_nomg</code> and <code>TRUE_nomg_NN</code> do not perform &#39;get&#39; magic; the others do unless the scalar is already <code>SvPOK</code>, <code>SvIOK</code>, or <code>SvNOK</code> (the public, not the private flags).</p>

<p><code>SvTRUE_NN</code> is like <code><a href="perlapi.html#SvTRUE">&quot;SvTRUE&quot;</a></code>, but <code>sv</code> is assumed to be non-null (NN). If there is a possibility that it is NULL, use plain <code>SvTRUE</code>.</p>

<p><code>SvTRUE_nomg_NN</code> is like <code><a href="perlapi.html#SvTRUE_nomg">&quot;SvTRUE_nomg&quot;</a></code>, but <code>sv</code> is assumed to be non-null (NN). If there is a possibility that it is NULL, use plain <code>SvTRUE_nomg</code>.</p>

<ul>

<pre><code class="plaintext">bool  SvTRUE(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvTYPE"><a class="permalink" href="perlapi.html#SvTYPE">#</a><code>SvTYPE</code> </dt>
<dd>

<p>Returns the type of the SV. See <code><a href="perlapi.html#svtype">&quot;svtype&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">svtype  SvTYPE(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUNLOCK"><a class="permalink" href="perlapi.html#SvUNLOCK">#</a><code>SvUNLOCK</code> </dt>
<dd>

<p>Releases a mutual exclusion lock on <code>sv</code> if a suitable module has been loaded.</p>

<ul>

<pre><code class="plaintext">void  SvUNLOCK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_unmagic"><a class="permalink" href="perlapi.html#sv_unmagic">#</a><code>sv_unmagic</code> </dt>
<dd>

<p>Removes all magic of type <code>type</code> from an SV.</p>

<ul>

<pre><code class="plaintext">int  sv_unmagic(SV *const sv, const int type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_unmagicext"><a class="permalink" href="perlapi.html#sv_unmagicext">#</a><code>sv_unmagicext</code> </dt>
<dd>

<p>Removes all magic of type <code>type</code> with the specified <code>vtbl</code> from an SV.</p>

<ul>

<pre><code class="plaintext">int  sv_unmagicext(SV *const sv, const int type, MGVTBL *vtbl)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_unref"><a class="permalink" href="perlapi.html#sv_unref">#</a><code>sv_unref</code> </dt>
<dd>

<p>Unsets the RV status of the SV, and decrements the reference count of whatever was being referenced by the RV. This can almost be thought of as a reversal of <code>newSVrv</code>. This is <code>sv_unref_flags</code> with the <code>flag</code> being zero. See <code><a href="perlapi.html#SvROK_off">&quot;SvROK_off&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_unref(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_unref_flags"><a class="permalink" href="perlapi.html#sv_unref_flags">#</a><code>sv_unref_flags</code> </dt>
<dd>

<p>Unsets the RV status of the SV, and decrements the reference count of whatever was being referenced by the RV. This can almost be thought of as a reversal of <code>newSVrv</code>. The <code>cflags</code> argument can contain <code>SV_IMMEDIATE_UNREF</code> to force the reference count to be decremented (otherwise the decrementing is conditional on the reference count being different from one or the reference being a readonly SV). See <code><a href="perlapi.html#SvROK_off">&quot;SvROK_off&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_unref_flags(SV *const ref, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUOK"><a class="permalink" href="perlapi.html#SvUOK">#</a><code>SvUOK</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV contains an integer that must be interpreted as unsigned. A non-negative integer whose value is within the range of both an IV and a UV may be flagged as either <code>SvUOK</code> or <code>SvIOK</code>.</p>

<ul>

<pre><code class="plaintext">bool  SvUOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUPGRADE"><a class="permalink" href="perlapi.html#SvUPGRADE">#</a><code>SvUPGRADE</code> </dt>
<dd>

<p>Used to upgrade an SV to a more complex form. Uses <code>sv_upgrade</code> to perform the upgrade if necessary. See <code><a href="perlapi.html#svtype">&quot;svtype&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvUPGRADE(SV* sv, svtype type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_upgrade"><a class="permalink" href="perlapi.html#sv_upgrade">#</a><code>sv_upgrade</code> </dt>
<dd>

<p>Upgrade an SV to a more complex form. Generally adds a new body type to the SV, then copies across as much information as possible from the old body. It croaks if the SV is already in a more complex form than requested. You generally want to use the <code>SvUPGRADE</code> macro wrapper, which checks the type before calling <code>sv_upgrade</code>, and hence does not croak. See also <code><a href="perlapi.html#svtype">&quot;svtype&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_upgrade(SV *const sv, svtype new_type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_usepvn"><a class="permalink" href="perlapi.html#sv_usepvn">#</a><code>sv_usepvn</code> </dt>
<dd>

<p>Tells an SV to use <code>ptr</code> to find its string value. Implemented by calling <code>sv_usepvn_flags</code> with <code>flags</code> of 0, hence does not handle &#39;set&#39; magic. See <code><a href="perlapi.html#sv_usepvn_flags">&quot;sv_usepvn_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_usepvn(SV* sv, char* ptr, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_usepvn_flags"><a class="permalink" href="perlapi.html#sv_usepvn_flags">#</a><code>sv_usepvn_flags</code> </dt>
<dd>

<p>Tells an SV to use <code>ptr</code> to find its string value. Normally the string is stored inside the SV, but sv_usepvn allows the SV to use an outside string. <code>ptr</code> should point to memory that was allocated by <a href="perlclib.html#Memory-Management-and-String-Handling"><code>Newx</code></a>. It must be the start of a <code>Newx</code>-ed block of memory, and not a pointer to the middle of it (beware of <a href="perlguts.html#Offsets"><code>OOK</code></a> and copy-on-write), and not be from a non-<code>Newx</code> memory allocator like <code>malloc</code>. The string length, <code>len</code>, must be supplied. By default this function will <code>Renew</code> (i.e. realloc, move) the memory pointed to by <code>ptr</code>, so that pointer should not be freed or used by the programmer after giving it to <code>sv_usepvn</code>, and neither should any pointers from &quot;behind&quot; that pointer (e.g. ptr + 1) be used.</p>

<p>If <span style="white-space: nowrap;"><code>flags &amp; SV_SMAGIC</code></span> is true, will call <code>SvSETMAGIC</code>. If <span style="white-space: nowrap;"><code>flags &amp; SV_HAS_TRAILING_NUL</code></span> is true, then <code>ptr[len]</code> must be <code>NUL</code>, and the realloc will be skipped (i.e. the buffer is actually at least 1 byte longer than <code>len</code>, and already meets the requirements for storing in <code>SvPVX</code>).</p>

<ul>

<pre><code class="plaintext">void  sv_usepvn_flags(SV *const sv, char* ptr, const STRLEN len,
                      const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_usepvn_mg"><a class="permalink" href="perlapi.html#sv_usepvn_mg">#</a><code>sv_usepvn_mg</code> </dt>
<dd>

<p>Like <code>sv_usepvn</code>, but also handles &#39;set&#39; magic.</p>

<ul>

<pre><code class="plaintext">void  sv_usepvn_mg(SV *sv, char *ptr, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUTF8"><a class="permalink" href="perlapi.html#SvUTF8">#</a><code>SvUTF8</code> </dt>
<dd>

<p>Returns a U32 value indicating the UTF-8 status of an SV. If things are set-up properly, this indicates whether or not the SV contains UTF-8 encoded data. You should use this <i>after</i> a call to <code><a href="perlapi.html#SvPV">&quot;SvPV&quot;</a></code> or one of its variants, in case any call to string overloading updates the internal flag.</p>

<p>If you want to take into account the <a href="bytes.html">bytes</a> pragma, use <code><a href="perlapi.html#DO_UTF8">&quot;DO_UTF8&quot;</a></code> instead.</p>

<ul>

<pre><code class="plaintext">U32  SvUTF8(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_utf8_decode"><a class="permalink" href="perlapi.html#sv_utf8_decode">#</a><code>sv_utf8_decode</code> </dt>
<dd>

<p>If the PV of the SV is an octet sequence in Perl&#39;s extended UTF-8 and contains a multiple-byte character, the <code>SvUTF8</code> flag is turned on so that it looks like a character. If the PV contains only single-byte characters, the <code>SvUTF8</code> flag stays off. Scans PV for validity and returns FALSE if the PV is invalid UTF-8.</p>

<ul>

<pre><code class="plaintext">bool  sv_utf8_decode(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_utf8_downgrade"><a class="permalink" href="perlapi.html#sv_utf8_downgrade">#</a><code>sv_utf8_downgrade</code></dt>
<dd>

</dd>
<dt id="sv_utf8_downgrade_flags"><a class="permalink" href="perlapi.html#sv_utf8_downgrade_flags">#</a><code>sv_utf8_downgrade_flags</code></dt>
<dd>

</dd>
<dt id="sv_utf8_downgrade_nomg"><a class="permalink" href="perlapi.html#sv_utf8_downgrade_nomg">#</a><code>sv_utf8_downgrade_nomg</code> </dt>
<dd>

<p>These attempt to convert the PV of an SV from characters to bytes. If the PV contains a character that cannot fit in a byte, this conversion will fail; in this case, <code>FALSE</code> is returned if <code>fail_ok</code> is true; otherwise they croak.</p>

<p>They are not a general purpose Unicode to byte encoding interface: use the <code>Encode</code> extension for that.</p>

<p>They differ only in that:</p>

<p><code>sv_utf8_downgrade</code> processes &#39;get&#39; magic on <code>sv</code>.</p>

<p><code>sv_utf8_downgrade_nomg</code> does not.</p>

<p><code>sv_utf8_downgrade_flags</code> has an additional <code>flags</code> parameter in which you can specify <code>SV_GMAGIC</code> to process &#39;get&#39; magic, or leave it cleared to not proccess &#39;get&#39; magic.</p>

<ul>

<pre><code class="plaintext">bool  sv_utf8_downgrade      (SV *const sv, const bool fail_ok)
bool  sv_utf8_downgrade_flags(SV *const sv, const bool fail_ok,
                              const U32 flags)
bool  sv_utf8_downgrade_nomg (SV *const sv, const bool fail_ok)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_utf8_encode"><a class="permalink" href="perlapi.html#sv_utf8_encode">#</a><code>sv_utf8_encode</code> </dt>
<dd>

<p>Converts the PV of an SV to UTF-8, but then turns the <code>SvUTF8</code> flag off so that it looks like octets again.</p>

<ul>

<pre><code class="plaintext">void  sv_utf8_encode(SV *const sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_utf8_upgrade"><a class="permalink" href="perlapi.html#sv_utf8_upgrade">#</a><code>sv_utf8_upgrade</code></dt>
<dd>

</dd>
<dt id="sv_utf8_upgrade_nomg"><a class="permalink" href="perlapi.html#sv_utf8_upgrade_nomg">#</a><code>sv_utf8_upgrade_nomg</code></dt>
<dd>

</dd>
<dt id="sv_utf8_upgrade_flags"><a class="permalink" href="perlapi.html#sv_utf8_upgrade_flags">#</a><code>sv_utf8_upgrade_flags</code></dt>
<dd>

</dd>
<dt id="sv_utf8_upgrade_flags_grow"><a class="permalink" href="perlapi.html#sv_utf8_upgrade_flags_grow">#</a><code>sv_utf8_upgrade_flags_grow</code> </dt>
<dd>

<p>These convert the PV of an SV to its UTF-8-encoded form. The SV is forced to string form if it is not already. They always set the <code>SvUTF8</code> flag to avoid future validity checks even if the whole string is the same in UTF-8 as not. They return the number of bytes in the converted string</p>

<p>The forms differ in just two ways. The main difference is whether or not they perform &#39;get magic&#39; on <code>sv</code>. <code>sv_utf8_upgrade_nomg</code> skips &#39;get magic&#39;; <code>sv_utf8_upgrade</code> performs it; and <code>sv_utf8_upgrade_flags</code> and <code>sv_utf8_upgrade_flags_grow</code> either perform it (if the <code>SV_GMAGIC</code> bit is set in <code>flags</code>) or don&#39;t (if that bit is cleared).</p>

<p>The other difference is that <code>sv_utf8_upgrade_flags_grow</code> has an additional parameter, <code>extra</code>, which allows the caller to specify an amount of space to be reserved as spare beyond what is needed for the actual conversion. This is used when the caller knows it will soon be needing yet more space, and it is more efficient to request space from the system in a single call. This form is otherwise identical to <code>sv_utf8_upgrade_flags</code>.</p>

<p>These are not a general purpose byte encoding to Unicode interface: use the Encode extension for that.</p>

<p>The <code>SV_FORCE_UTF8_UPGRADE</code> flag is now ignored.</p>

<ul>

<pre><code class="plaintext">STRLEN  sv_utf8_upgrade           (SV *sv)
STRLEN  sv_utf8_upgrade_nomg      (SV *sv)
STRLEN  sv_utf8_upgrade_flags     (SV *const sv, const I32 flags)
STRLEN  sv_utf8_upgrade_flags_grow(SV *const sv, const I32 flags,
                                   STRLEN extra)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUTF8_off"><a class="permalink" href="perlapi.html#SvUTF8_off">#</a><code>SvUTF8_off</code> </dt>
<dd>

<p>Unsets the UTF-8 status of an SV (the data is not changed, just the flag). Do not use frivolously.</p>

<ul>

<pre><code class="plaintext">void  SvUTF8_off(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUTF8_on"><a class="permalink" href="perlapi.html#SvUTF8_on">#</a><code>SvUTF8_on</code> </dt>
<dd>

<p>Turn on the UTF-8 status of an SV (the data is not changed, just the flag). Do not use frivolously.</p>

<ul>

<pre><code class="plaintext">void  SvUTF8_on(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUV"><a class="permalink" href="perlapi.html#SvUV">#</a><code>SvUV</code></dt>
<dd>

</dd>
<dt id="SvUVx"><a class="permalink" href="perlapi.html#SvUVx">#</a><code>SvUVx</code></dt>
<dd>

</dd>
<dt id="SvUV_nomg"><a class="permalink" href="perlapi.html#SvUV_nomg">#</a><code>SvUV_nomg</code> </dt>
<dd>

<p>These coerce the given SV to UV and return it. The returned value in many circumstances will get stored in <code>sv</code>&#39;s UV slot, but not in all cases. (Use <code><a href="perlapi.html#sv_setuv">&quot;sv_setuv&quot;</a></code> to make sure it does).</p>

<p><code>SvUVx</code> is different from the others in that it is guaranteed to evaluate <code>sv</code> exactly once; the others may evaluate it multiple times. Only use this form if <code>sv</code> is an expression with side effects, otherwise use the more efficient <code>SvUV</code>.</p>

<p><code>SvUV_nomg</code> is the same as <code>SvUV</code>, but does not perform &#39;get&#39; magic.</p>

<ul>

<pre><code class="plaintext">UV  SvUV(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUV_set"><a class="permalink" href="perlapi.html#SvUV_set">#</a><code>SvUV_set</code> </dt>
<dd>

<p>Set the value of the UV pointer in <code>sv</code> to val. See <code><a href="perlapi.html#SvIV_set">&quot;SvIV_set&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  SvUV_set(SV* sv, UV val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUVX"><a class="permalink" href="perlapi.html#SvUVX">#</a><code>SvUVX</code> </dt>
<dd>

<p>Returns the raw value in the SV&#39;s UV slot, without checks or conversions. Only use when you are sure <code>SvIOK</code> is true. See also <code><a href="perlapi.html#SvUV">&quot;SvUV&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">UV  SvUVX(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvUVXx"><a class="permalink" href="perlapi.html#SvUVXx">#</a><code>SvUVXx</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>SvUVXx</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>This is an unnecessary synonym for <a href="perlapi.html#SvUVX">&quot;SvUVX&quot;</a></p>

<ul>

<pre><code class="plaintext">UV  SvUVXx(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_vcatpvf"><a class="permalink" href="perlapi.html#sv_vcatpvf">#</a><code>sv_vcatpvf</code></dt>
<dd>

</dd>
<dt id="sv_vcatpvf_mg"><a class="permalink" href="perlapi.html#sv_vcatpvf_mg">#</a><code>sv_vcatpvf_mg</code> </dt>
<dd>

<p>These process their arguments like <code>sv_vcatpvfn</code> called with a non-null C-style variable argument list, and append the formatted output to <code>sv</code>.</p>

<p>They differ only in that <code>sv_vcatpvf_mg</code> performs &#39;set&#39; magic; <code>sv_vcatpvf</code> skips &#39;set&#39; magic.</p>

<p>Both perform &#39;get&#39; magic.</p>

<p>They are usually accessed via their frontends <code><a href="perlapi.html#sv_catpvf">&quot;sv_catpvf&quot;</a></code> and <code><a href="perlapi.html#sv_catpvf_mg">&quot;sv_catpvf_mg&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_vcatpvf(SV *const sv, const char *const pat,
                 va_list *const args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_vcatpvfn"><a class="permalink" href="perlapi.html#sv_vcatpvfn">#</a><code>sv_vcatpvfn</code></dt>
<dd>

</dd>
<dt id="sv_vcatpvfn_flags"><a class="permalink" href="perlapi.html#sv_vcatpvfn_flags">#</a><code>sv_vcatpvfn_flags</code> </dt>
<dd>

<p>These process their arguments like <code><a href="http://man.he.net/man3/vsprintf">vsprintf(3)</a></code> and append the formatted output to an SV. They use an array of SVs if the C-style variable argument list is missing (<code>NULL</code>). Argument reordering (using format specifiers like <code>%2$d</code> or <code>%*2$d</code>) is supported only when using an array of SVs; using a C-style <code>va_list</code> argument list with a format string that uses argument reordering will yield an exception.</p>

<p>When running with taint checks enabled, they indicate via <code>maybe_tainted</code> if results are untrustworthy (often due to the use of locales).</p>

<p>They assume that <code>pat</code> has the same utf8-ness as <code>sv</code>. It&#39;s the caller&#39;s responsibility to ensure that this is so.</p>

<p>They differ in that <code>sv_vcatpvfn_flags</code> has a <code>flags</code> parameter in which you can set or clear the <code>SV_GMAGIC</code> and/or <span style="white-space: nowrap;">SV_SMAGIC</span> flags, to specify which magic to handle or not handle; whereas plain <code>sv_vcatpvfn</code> always specifies both &#39;get&#39; and &#39;set&#39; magic.</p>

<p>They are usually used via one of the frontends <code>sv_vcatpvf</code> and <code>sv_vcatpvf_mg</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_vcatpvfn      (SV *const sv, const char *const pat,
                        const STRLEN patlen, va_list *const args,
                        SV **const svargs, const Size_t sv_count,
                        bool *const maybe_tainted)
void  sv_vcatpvfn_flags(SV *const sv, const char *const pat,
                        const STRLEN patlen, va_list *const args,
                        SV **const svargs, const Size_t sv_count,
                        bool *const maybe_tainted,
                        const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvVOK"><a class="permalink" href="perlapi.html#SvVOK">#</a><code>SvVOK</code> </dt>
<dd>

<p>Returns a boolean indicating whether the SV contains a v-string.</p>

<ul>

<pre><code class="plaintext">bool  SvVOK(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_vsetpvf"><a class="permalink" href="perlapi.html#sv_vsetpvf">#</a><code>sv_vsetpvf</code></dt>
<dd>

</dd>
<dt id="sv_vsetpvf_mg"><a class="permalink" href="perlapi.html#sv_vsetpvf_mg">#</a><code>sv_vsetpvf_mg</code> </dt>
<dd>

<p>These work like <code><a href="perlapi.html#sv_vcatpvf">&quot;sv_vcatpvf&quot;</a></code> but copy the text into the SV instead of appending it.</p>

<p>They differ only in that <code>sv_vsetpvf_mg</code> performs &#39;set&#39; magic; <code>sv_vsetpvf</code> skips all magic.</p>

<p>They are usually used via their frontends, <code><a href="perlapi.html#sv_setpvf">&quot;sv_setpvf&quot;</a></code> and <code><a href="perlapi.html#sv_setpvf_mg">&quot;sv_setpvf_mg&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">void  sv_vsetpvf(SV *const sv, const char *const pat,
                 va_list *const args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_vsetpvfn"><a class="permalink" href="perlapi.html#sv_vsetpvfn">#</a><code>sv_vsetpvfn</code> </dt>
<dd>

<p>Works like <code>sv_vcatpvfn</code> but copies the text into the SV instead of appending it.</p>

<p>Usually used via one of its frontends <code>sv_vsetpvf</code> and <code>sv_vsetpvf_mg</code>.</p>

<ul>

<pre><code class="plaintext">void  sv_vsetpvfn(SV *const sv, const char *const pat,
                  const STRLEN patlen, va_list *const args,
                  SV **const svargs, const Size_t sv_count,
                  bool *const maybe_tainted)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SvVSTRING_mg"><a class="permalink" href="perlapi.html#SvVSTRING_mg">#</a><code>SvVSTRING_mg</code> </dt>
<dd>

<p>Returns the vstring magic, or NULL if none</p>

<ul>

<pre><code class="plaintext">MAGIC*  SvVSTRING_mg(SV * sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vnewSVpvf"><a class="permalink" href="perlapi.html#vnewSVpvf">#</a><code>vnewSVpvf</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#newSVpvf">&quot;newSVpvf&quot;</a></code> but but the arguments are an encapsulated argument list.</p>

<ul>

<pre><code class="plaintext">SV*  vnewSVpvf(const char *const pat, va_list *const args)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Time"><a class="permalink" href="perlapi.html#Time">#</a>Time</h1>

<dl>

<dt id="ASCTIME_R_PROTO"><a class="permalink" href="perlapi.html#ASCTIME_R_PROTO">#</a><code>ASCTIME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>asctime_r</code>. It is zero if <code>d_asctime_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_asctime_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="CTIME_R_PROTO"><a class="permalink" href="perlapi.html#CTIME_R_PROTO">#</a><code>CTIME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>ctime_r</code>. It is zero if <code>d_ctime_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_ctime_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="GMTIME_MAX"><a class="permalink" href="perlapi.html#GMTIME_MAX">#</a><code>GMTIME_MAX</code> </dt>
<dd>

<p>This symbol contains the maximum value for the <code>time_t</code> offset that the system function gmtime () accepts, and defaults to 0</p>

</dd>
</dl>

<dl>

<dt id="GMTIME_MIN"><a class="permalink" href="perlapi.html#GMTIME_MIN">#</a><code>GMTIME_MIN</code> </dt>
<dd>

<p>This symbol contains the minimum value for the <code>time_t</code> offset that the system function gmtime () accepts, and defaults to 0</p>

</dd>
</dl>

<dl>

<dt id="GMTIME_R_PROTO"><a class="permalink" href="perlapi.html#GMTIME_R_PROTO">#</a><code>GMTIME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>gmtime_r</code>. It is zero if <code>d_gmtime_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_gmtime_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="HAS_ASCTIME64"><a class="permalink" href="perlapi.html#HAS_ASCTIME64">#</a><code>HAS_ASCTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>asctime64</code> () routine is available to do the 64bit variant of asctime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_ASCTIME_R"><a class="permalink" href="perlapi.html#HAS_ASCTIME_R">#</a><code>HAS_ASCTIME_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>asctime_r</code> routine is available to asctime re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_CTIME64"><a class="permalink" href="perlapi.html#HAS_CTIME64">#</a><code>HAS_CTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>ctime64</code> () routine is available to do the 64bit variant of ctime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_CTIME_R"><a class="permalink" href="perlapi.html#HAS_CTIME_R">#</a><code>HAS_CTIME_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>ctime_r</code> routine is available to ctime re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DIFFTIME"><a class="permalink" href="perlapi.html#HAS_DIFFTIME">#</a><code>HAS_DIFFTIME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>difftime</code> routine is available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_DIFFTIME64"><a class="permalink" href="perlapi.html#HAS_DIFFTIME64">#</a><code>HAS_DIFFTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>difftime64</code> () routine is available to do the 64bit variant of difftime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_FUTIMES"><a class="permalink" href="perlapi.html#HAS_FUTIMES">#</a><code>HAS_FUTIMES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>futimes</code> routine is available to change file descriptor time stamps with <code>struct timevals</code>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETITIMER"><a class="permalink" href="perlapi.html#HAS_GETITIMER">#</a><code>HAS_GETITIMER</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>getitimer</code> routine is available to return interval timers.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GETTIMEOFDAY"><a class="permalink" href="perlapi.html#HAS_GETTIMEOFDAY">#</a><code>HAS_GETTIMEOFDAY</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>gettimeofday()</code> system call is available for a sub-second accuracy clock. Usually, the file <i>sys/resource.h</i> needs to be included (see <code><a href="perlapi.html#I_SYS_RESOURCE">&quot;I_SYS_RESOURCE&quot;</a></code>). The type &quot;Timeval&quot; should be used to refer to &quot;<code>struct timeval</code>&quot;.</p>

</dd>
</dl>

<dl>

<dt id="HAS_GMTIME64"><a class="permalink" href="perlapi.html#HAS_GMTIME64">#</a><code>HAS_GMTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>gmtime64</code> () routine is available to do the 64bit variant of gmtime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_GMTIME_R"><a class="permalink" href="perlapi.html#HAS_GMTIME_R">#</a><code>HAS_GMTIME_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>gmtime_r</code> routine is available to gmtime re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_LOCALTIME64"><a class="permalink" href="perlapi.html#HAS_LOCALTIME64">#</a><code>HAS_LOCALTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>localtime64</code> () routine is available to do the 64bit variant of localtime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_LOCALTIME_R"><a class="permalink" href="perlapi.html#HAS_LOCALTIME_R">#</a><code>HAS_LOCALTIME_R</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>localtime_r</code> routine is available to localtime re-entrantly.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MKTIME"><a class="permalink" href="perlapi.html#HAS_MKTIME">#</a><code>HAS_MKTIME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>mktime</code> routine is available.</p>

</dd>
</dl>

<dl>

<dt id="HAS_MKTIME64"><a class="permalink" href="perlapi.html#HAS_MKTIME64">#</a><code>HAS_MKTIME64</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>mktime64</code> () routine is available to do the 64bit variant of mktime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_NANOSLEEP"><a class="permalink" href="perlapi.html#HAS_NANOSLEEP">#</a><code>HAS_NANOSLEEP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>nanosleep</code> system call is available to sleep with 1E-9 sec accuracy.</p>

</dd>
</dl>

<dl>

<dt id="HAS_SETITIMER"><a class="permalink" href="perlapi.html#HAS_SETITIMER">#</a><code>HAS_SETITIMER</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>setitimer</code> routine is available to set interval timers.</p>

</dd>
</dl>

<dl>

<dt id="HAS_STRFTIME"><a class="permalink" href="perlapi.html#HAS_STRFTIME">#</a><code>HAS_STRFTIME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>strftime</code> routine is available to do time formatting.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TIME"><a class="permalink" href="perlapi.html#HAS_TIME">#</a><code>HAS_TIME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>time()</code> routine exists.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TIMEGM"><a class="permalink" href="perlapi.html#HAS_TIMEGM">#</a><code>HAS_TIMEGM</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>timegm</code> routine is available to do the opposite of gmtime ()</p>

</dd>
</dl>

<dl>

<dt id="HAS_TIMES"><a class="permalink" href="perlapi.html#HAS_TIMES">#</a><code>HAS_TIMES</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>times()</code> routine exists. Note that this became obsolete on some systems (<code>SUNOS</code>), which now use <code>getrusage()</code>. It may be necessary to include <i>sys/times.h</i>.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TM_TM_GMTOFF"><a class="permalink" href="perlapi.html#HAS_TM_TM_GMTOFF">#</a><code>HAS_TM_TM_GMTOFF</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>struct tm</code> has a <code>tm_gmtoff</code> field.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TM_TM_ZONE"><a class="permalink" href="perlapi.html#HAS_TM_TM_ZONE">#</a><code>HAS_TM_TM_ZONE</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that the <code>struct tm</code> has a <code>tm_zone</code> field.</p>

</dd>
</dl>

<dl>

<dt id="HAS_TZNAME"><a class="permalink" href="perlapi.html#HAS_TZNAME">#</a><code>HAS_TZNAME</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>tzname[]</code> array is available to access timezone names.</p>

</dd>
</dl>

<dl>

<dt id="HAS_USLEEP"><a class="permalink" href="perlapi.html#HAS_USLEEP">#</a><code>HAS_USLEEP</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the <code>usleep</code> routine is available to let the process sleep on a sub-second accuracy.</p>

</dd>
</dl>

<dl>

<dt id="HAS_USLEEP_PROTO"><a class="permalink" href="perlapi.html#HAS_USLEEP_PROTO">#</a><code>HAS_USLEEP_PROTO</code> </dt>
<dd>

<p>This symbol, if defined, indicates that the system provides a prototype for the <code>usleep()</code> function. Otherwise, it is up to the program to supply one. A good guess is</p>

<pre><code>extern int usleep(useconds_t);</code></pre>

</dd>
</dl>

<dl>

<dt id="I_TIME"><a class="permalink" href="perlapi.html#I_TIME">#</a><code>I_TIME</code> </dt>
<dd>

<p>This symbol is always defined, and indicates to the C program that it should include <i>time.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_TIME
    #include &lt;time.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="I_UTIME"><a class="permalink" href="perlapi.html#I_UTIME">#</a><code>I_UTIME</code> </dt>
<dd>

<p>This symbol, if defined, indicates to the C program that it should include <i>utime.h</i>.</p>

<ul>

<pre><code class="plaintext">#ifdef I_UTIME
    #include &lt;utime.h&gt;
#endif</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LOCALTIME_MAX"><a class="permalink" href="perlapi.html#LOCALTIME_MAX">#</a><code>LOCALTIME_MAX</code> </dt>
<dd>

<p>This symbol contains the maximum value for the <code>time_t</code> offset that the system function localtime () accepts, and defaults to 0</p>

</dd>
</dl>

<dl>

<dt id="LOCALTIME_MIN"><a class="permalink" href="perlapi.html#LOCALTIME_MIN">#</a><code>LOCALTIME_MIN</code> </dt>
<dd>

<p>This symbol contains the minimum value for the <code>time_t</code> offset that the system function localtime () accepts, and defaults to 0</p>

</dd>
</dl>

<dl>

<dt id="LOCALTIME_R_NEEDS_TZSET"><a class="permalink" href="perlapi.html#LOCALTIME_R_NEEDS_TZSET">#</a><code>LOCALTIME_R_NEEDS_TZSET</code> </dt>
<dd>

<p>Many libc&#39;s <code>localtime_r</code> implementations do not call tzset, making them differ from <code>localtime()</code>, and making timezone changes using $<code>ENV</code>{TZ} without explicitly calling tzset impossible. This symbol makes us call tzset before <code>localtime_r</code></p>

</dd>
</dl>

<dl>

<dt id="LOCALTIME_R_PROTO"><a class="permalink" href="perlapi.html#LOCALTIME_R_PROTO">#</a><code>LOCALTIME_R_PROTO</code> </dt>
<dd>

<p>This symbol encodes the prototype of <code>localtime_r</code>. It is zero if <code>d_localtime_r</code> is undef, and one of the <code>REENTRANT_PROTO_T_ABC</code> macros of <i>reentr.h</i> if <code>d_localtime_r</code> is defined.</p>

</dd>
</dl>

<dl>

<dt id="L_R_TZSET"><a class="permalink" href="perlapi.html#L_R_TZSET">#</a><code>L_R_TZSET</code> </dt>
<dd>

<p>If <code>localtime_r()</code> needs tzset, it is defined in this define</p>

</dd>
</dl>

<dl>

<dt id="mini_mktime"><a class="permalink" href="perlapi.html#mini_mktime">#</a><code>mini_mktime</code> </dt>
<dd>

<p>normalise <span style="white-space: nowrap;"><code>struct tm</code></span> values without the localtime() semantics (and overhead) of mktime().</p>

<ul>

<pre><code class="plaintext">void  mini_mktime(struct tm *ptm)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_strftime"><a class="permalink" href="perlapi.html#my_strftime">#</a><code>my_strftime</code> </dt>
<dd>

<p>strftime(), but with a different API so that the return value is a pointer to the formatted result (which MUST be arranged to be FREED BY THE CALLER). This allows this function to increase the buffer size as needed, so that the caller doesn&#39;t have to worry about that.</p>

<p>Note that yday and wday effectively are ignored by this function, as mini_mktime() overwrites them</p>

<p>Also note that this is always executed in the underlying locale of the program, giving localized results.</p>

<p>NOTE: <code>my_strftime</code> must be explicitly called as <code>Perl_my_strftime</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">char *  Perl_my_strftime(pTHX_ const char *fmt, int sec, int min,
                         int hour, int mday, int mon, int year,
                         int wday, int yday, int isdst)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Typedef-names"><a class="permalink" href="perlapi.html#Typedef-names">#</a><a id="Typedef"></a>Typedef names</h1>

<dl>

<dt id="DB_Hash_t"><a class="permalink" href="perlapi.html#DB_Hash_t">#</a><code>DB_Hash_t</code> </dt>
<dd>

<p>This symbol contains the type of the prefix structure element in the <i>db.h</i> header file. In older versions of DB, it was int, while in newer ones it is <code>size_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="DB_Prefix_t"><a class="permalink" href="perlapi.html#DB_Prefix_t">#</a><code>DB_Prefix_t</code> </dt>
<dd>

<p>This symbol contains the type of the prefix structure element in the <i>db.h</i> header file. In older versions of DB, it was int, while in newer ones it is <code>u_int32_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="Direntry_t"><a class="permalink" href="perlapi.html#Direntry_t">#</a><code>Direntry_t</code> </dt>
<dd>

<p>This symbol is set to &#39;<code>struct direct</code>&#39; or &#39;<code>struct dirent</code>&#39; depending on whether dirent is available or not. You should use this pseudo type to portably declare your directory entries.</p>

</dd>
</dl>

<dl>

<dt id="Fpos_t"><a class="permalink" href="perlapi.html#Fpos_t">#</a><code>Fpos_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare file positions in libc. It can be <code>fpos_t</code>, long, uint, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Free_t"><a class="permalink" href="perlapi.html#Free_t">#</a><code>Free_t</code> </dt>
<dd>

<p>This variable contains the return type of <code>free()</code>. It is usually void, but occasionally int.</p>

</dd>
</dl>

<dl>

<dt id="Gid_t"><a class="permalink" href="perlapi.html#Gid_t">#</a><code>Gid_t</code> </dt>
<dd>

<p>This symbol holds the return type of <code>getgid()</code> and the type of argument to <code>setrgid()</code> and related functions. Typically, it is the type of group ids in the kernel. It can be int, ushort, <code>gid_t</code>, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Gid_t_f"><a class="permalink" href="perlapi.html#Gid_t_f">#</a><code>Gid_t_f</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a <code>Gid_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="Gid_t_sign"><a class="permalink" href="perlapi.html#Gid_t_sign">#</a><code>Gid_t_sign</code> </dt>
<dd>

<p>This symbol holds the signedness of a <code>Gid_t</code>. 1 for unsigned, -1 for signed.</p>

</dd>
</dl>

<dl>

<dt id="Gid_t_size"><a class="permalink" href="perlapi.html#Gid_t_size">#</a><code>Gid_t_size</code> </dt>
<dd>

<p>This symbol holds the size of a <code>Gid_t</code> in bytes.</p>

</dd>
</dl>

<dl>

<dt id="Groups_t"><a class="permalink" href="perlapi.html#Groups_t">#</a><code>Groups_t</code> </dt>
<dd>

<p>This symbol holds the type used for the second argument to <code>getgroups()</code> and <code>setgroups()</code>. Usually, this is the same as gidtype (<code>gid_t</code>) , but sometimes it isn&#39;t. It can be int, ushort, <code>gid_t</code>, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information. This is only required if you have <code>getgroups()</code> or <code>setgroups()</code>..</p>

</dd>
</dl>

<dl>

<dt id="Malloc_t"><a class="permalink" href="perlapi.html#Malloc_t">#</a><code>Malloc_t</code> </dt>
<dd>

<p>This symbol is the type of pointer returned by malloc and realloc.</p>

</dd>
</dl>

<dl>

<dt id="Mmap_t"><a class="permalink" href="perlapi.html#Mmap_t">#</a><code>Mmap_t</code> </dt>
<dd>

<p>This symbol holds the return type of the <code>mmap()</code> system call (and simultaneously the type of the first argument). Usually set to &#39;void *&#39; or &#39;<code>caddr_t</code>&#39;.</p>

</dd>
</dl>

<dl>

<dt id="Mode_t"><a class="permalink" href="perlapi.html#Mode_t">#</a><code>Mode_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare file modes for systems calls. It is usually <code>mode_t</code>, but may be int or unsigned short. It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Netdb_hlen_t"><a class="permalink" href="perlapi.html#Netdb_hlen_t">#</a><code>Netdb_hlen_t</code> </dt>
<dd>

<p>This symbol holds the type used for the 2nd argument to <code>gethostbyaddr()</code>.</p>

</dd>
</dl>

<dl>

<dt id="Netdb_host_t"><a class="permalink" href="perlapi.html#Netdb_host_t">#</a><code>Netdb_host_t</code> </dt>
<dd>

<p>This symbol holds the type used for the 1st argument to <code>gethostbyaddr()</code>.</p>

</dd>
</dl>

<dl>

<dt id="Netdb_name_t"><a class="permalink" href="perlapi.html#Netdb_name_t">#</a><code>Netdb_name_t</code> </dt>
<dd>

<p>This symbol holds the type used for the argument to <code>gethostbyname()</code>.</p>

</dd>
</dl>

<dl>

<dt id="Netdb_net_t"><a class="permalink" href="perlapi.html#Netdb_net_t">#</a><code>Netdb_net_t</code> </dt>
<dd>

<p>This symbol holds the type used for the 1st argument to <code>getnetbyaddr()</code>.</p>

</dd>
</dl>

<dl>

<dt id="Off_t"><a class="permalink" href="perlapi.html#Off_t">#</a><code>Off_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare offsets in the kernel. It can be int, long, <code>off_t</code>, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Off_t_size"><a class="permalink" href="perlapi.html#Off_t_size">#</a><code>Off_t_size</code> </dt>
<dd>

<p>This symbol holds the number of bytes used by the <code>Off_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="Pid_t"><a class="permalink" href="perlapi.html#Pid_t">#</a><code>Pid_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare process ids in the kernel. It can be int, uint, <code>pid_t</code>, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Rand_seed_t"><a class="permalink" href="perlapi.html#Rand_seed_t">#</a><code>Rand_seed_t</code> </dt>
<dd>

<p>This symbol defines the type of the argument of the random seed function.</p>

</dd>
</dl>

<dl>

<dt id="Select_fd_set_t"><a class="permalink" href="perlapi.html#Select_fd_set_t">#</a><code>Select_fd_set_t</code> </dt>
<dd>

<p>This symbol holds the type used for the 2nd, 3rd, and 4th arguments to select. Usually, this is &#39;<code>fd_set</code> *&#39;, if <code>HAS_FD_SET</code> is defined, and &#39;int *&#39; otherwise. This is only useful if you have <code>select()</code>, of course.</p>

</dd>
</dl>

<dl>

<dt id="Shmat_t"><a class="permalink" href="perlapi.html#Shmat_t">#</a><code>Shmat_t</code> </dt>
<dd>

<p>This symbol holds the return type of the <code>shmat()</code> system call. Usually set to &#39;void *&#39; or &#39;char *&#39;.</p>

</dd>
</dl>

<dl>

<dt id="Signal_t"><a class="permalink" href="perlapi.html#Signal_t">#</a><code>Signal_t</code> </dt>
<dd>

<p>This symbol&#39;s value is either &quot;void&quot; or &quot;int&quot;, corresponding to the appropriate return type of a signal handler. Thus, you can declare a signal handler using &quot;<code>Signal_t</code> (*handler)()&quot;, and define the handler using &quot;<code>Signal_t</code> <code>handler(sig)</code>&quot;.</p>

</dd>
</dl>

<dl>

<dt id="Size_t"><a class="permalink" href="perlapi.html#Size_t">#</a><code>Size_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare length parameters for string functions. It is usually <code>size_t</code>, but may be unsigned long, int, etc. It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Size_t_size"><a class="permalink" href="perlapi.html#Size_t_size">#</a><code>Size_t_size</code> </dt>
<dd>

<p>This symbol holds the size of a <code>Size_t</code> in bytes.</p>

</dd>
</dl>

<dl>

<dt id="Sock_size_t"><a class="permalink" href="perlapi.html#Sock_size_t">#</a><code>Sock_size_t</code> </dt>
<dd>

<p>This symbol holds the type used for the size argument of various socket calls (just the base type, not the pointer-to).</p>

</dd>
</dl>

<dl>

<dt id="SSize_t"><a class="permalink" href="perlapi.html#SSize_t">#</a><code>SSize_t</code> </dt>
<dd>

<p>This symbol holds the type used by functions that return a count of bytes or an error condition. It must be a signed type. It is usually <code>ssize_t</code>, but may be long or int, etc. It may be necessary to include <i>sys/types.h</i> or <i>unistd.h</i> to get any typedef&#39;ed information. We will pick a type such that <code>sizeof(SSize_t)</code> == <code>sizeof(Size_t)</code>.</p>

</dd>
</dl>

<dl>

<dt id="Time_t"><a class="permalink" href="perlapi.html#Time_t">#</a><code>Time_t</code> </dt>
<dd>

<p>This symbol holds the type returned by <code>time()</code>. It can be long, or <code>time_t</code> on <code>BSD</code> sites (in which case <i>sys/types.h</i> should be included).</p>

</dd>
</dl>

<dl>

<dt id="Uid_t"><a class="permalink" href="perlapi.html#Uid_t">#</a><code>Uid_t</code> </dt>
<dd>

<p>This symbol holds the type used to declare user ids in the kernel. It can be int, ushort, <code>uid_t</code>, etc... It may be necessary to include <i>sys/types.h</i> to get any typedef&#39;ed information.</p>

</dd>
</dl>

<dl>

<dt id="Uid_t_f"><a class="permalink" href="perlapi.html#Uid_t_f">#</a><code>Uid_t_f</code> </dt>
<dd>

<p>This symbol defines the format string used for printing a <code>Uid_t</code>.</p>

</dd>
</dl>

<dl>

<dt id="Uid_t_sign"><a class="permalink" href="perlapi.html#Uid_t_sign">#</a><code>Uid_t_sign</code> </dt>
<dd>

<p>This symbol holds the signedness of a <code>Uid_t</code>. 1 for unsigned, -1 for signed.</p>

</dd>
</dl>

<dl>

<dt id="Uid_t_size"><a class="permalink" href="perlapi.html#Uid_t_size">#</a><code>Uid_t_size</code> </dt>
<dd>

<p>This symbol holds the size of a <code>Uid_t</code> in bytes.</p>

</dd>
</dl>

<h1 id="Unicode-Support"><a class="permalink" href="perlapi.html#Unicode-Support">#</a><a id="Unicode"></a>Unicode Support</h1>

<p><a href="perlguts.html#Unicode-Support">&quot;Unicode Support&quot; in perlguts</a> has an introduction to this API.</p>

<p>See also <code><a href="perlapi.html#Character-classification">&quot;Character classification&quot;</a></code>, <code><a href="perlapi.html#Character-case-changing">&quot;Character case changing&quot;</a></code>, and <code><a href="perlapi.html#String-Handling">&quot;String Handling&quot;</a></code>. Various functions outside this section also work specially with Unicode. Search for the string &quot;utf8&quot; in this document.</p>

<dl>

<dt id="BOM_UTF8"><a class="permalink" href="perlapi.html#BOM_UTF8">#</a><code>BOM_UTF8</code> </dt>
<dd>

<p>This is a macro that evaluates to a string constant of the UTF-8 bytes that define the Unicode BYTE ORDER MARK (U+FEFF) for the platform that perl is compiled on. This allows code to use a mnemonic for this character that works on both ASCII and EBCDIC platforms. <span style="white-space: nowrap;"><code>sizeof(BOM_UTF8) - 1</code></span> can be used to get its length in bytes.</p>

</dd>
</dl>

<dl>

<dt id="bytes_cmp_utf8"><a class="permalink" href="perlapi.html#bytes_cmp_utf8">#</a><code>bytes_cmp_utf8</code> </dt>
<dd>

<p>Compares the sequence of characters (stored as octets) in <code>b</code>, <code>blen</code> with the sequence of characters (stored as UTF-8) in <code>u</code>, <code>ulen</code>. Returns 0 if they are equal, -1 or -2 if the first string is less than the second string, +1 or +2 if the first string is greater than the second string.</p>

<p>-1 or +1 is returned if the shorter string was identical to the start of the longer string. -2 or +2 is returned if there was a difference between characters within the strings.</p>

<ul>

<pre><code class="plaintext">int  bytes_cmp_utf8(const U8 *b, STRLEN blen, const U8 *u,
                    STRLEN ulen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="bytes_from_utf8"><a class="permalink" href="perlapi.html#bytes_from_utf8">#</a><code>bytes_from_utf8</code> </dt>
<dd>

<p>NOTE: <code>bytes_from_utf8</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Converts a potentially UTF-8 encoded string <code>s</code> of length <code>*lenp</code> into native byte encoding. On input, the boolean <code>*is_utf8p</code> gives whether or not <code>s</code> is actually encoded in UTF-8.</p>

<p>Unlike <a href="perlapi.html#utf8_to_bytes">&quot;utf8_to_bytes&quot;</a> but like <a href="perlapi.html#bytes_to_utf8">&quot;bytes_to_utf8&quot;</a>, this is non-destructive of the input string.</p>

<p>Do nothing if <code>*is_utf8p</code> is 0, or if there are code points in the string not expressible in native byte encoding. In these cases, <code>*is_utf8p</code> and <code>*lenp</code> are unchanged, and the return value is the original <code>s</code>.</p>

<p>Otherwise, <code>*is_utf8p</code> is set to 0, and the return value is a pointer to a newly created string containing a downgraded copy of <code>s</code>, and whose length is returned in <code>*lenp</code>, updated. The new string is <code>NUL</code>-terminated. The caller is responsible for arranging for the memory used by this string to get freed.</p>

<p>Upon successful return, the number of variants in the string can be computed by having saved the value of <code>*lenp</code> before the call, and subtracting the after-call value of <code>*lenp</code> from it.</p>

<ul>

<pre><code class="plaintext">U8*  bytes_from_utf8(const U8 *s, STRLEN *lenp, bool *is_utf8p)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="bytes_to_utf8"><a class="permalink" href="perlapi.html#bytes_to_utf8">#</a><code>bytes_to_utf8</code> </dt>
<dd>

<p>NOTE: <code>bytes_to_utf8</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Converts a string <code>s</code> of length <code>*lenp</code> bytes from the native encoding into UTF-8. Returns a pointer to the newly-created string, and sets <code>*lenp</code> to reflect the new length in bytes. The caller is responsible for arranging for the memory used by this string to get freed.</p>

<p>Upon successful return, the number of variants in the string can be computed by having saved the value of <code>*lenp</code> before the call, and subtracting it from the after-call value of <code>*lenp</code>.</p>

<p>A <code>NUL</code> character will be written after the end of the string.</p>

<p>If you want to convert to UTF-8 from encodings other than the native (Latin1 or EBCDIC), see <a href="perlapi.html#sv_recode_to_utf8">&quot;sv_recode_to_utf8&quot;</a>().</p>

<ul>

<pre><code class="plaintext">U8*  bytes_to_utf8(const U8 *s, STRLEN *lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="DO_UTF8"><a class="permalink" href="perlapi.html#DO_UTF8">#</a><code>DO_UTF8</code> </dt>
<dd>

<p>Returns a bool giving whether or not the PV in <code>sv</code> is to be treated as being encoded in UTF-8.</p>

<p>You should use this <i>after</i> a call to <code>SvPV()</code> or one of its variants, in case any call to string overloading updates the internal UTF-8 encoding flag.</p>

<ul>

<pre><code class="plaintext">bool  DO_UTF8(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="foldEQ_utf8"><a class="permalink" href="perlapi.html#foldEQ_utf8">#</a><code>foldEQ_utf8</code> </dt>
<dd>

<p>Returns true if the leading portions of the strings <code>s1</code> and <code>s2</code> (either or both of which may be in UTF-8) are the same case-insensitively; false otherwise. How far into the strings to compare is determined by other input parameters.</p>

<p>If <code>u1</code> is true, the string <code>s1</code> is assumed to be in UTF-8-encoded Unicode; otherwise it is assumed to be in native 8-bit encoding. Correspondingly for <code>u2</code> with respect to <code>s2</code>.</p>

<p>If the byte length <code>l1</code> is non-zero, it says how far into <code>s1</code> to check for fold equality. In other words, <code>s1</code>+<code>l1</code> will be used as a goal to reach. The scan will not be considered to be a match unless the goal is reached, and scanning won&#39;t continue past that goal. Correspondingly for <code>l2</code> with respect to <code>s2</code>.</p>

<p>If <code>pe1</code> is non-<code>NULL</code> and the pointer it points to is not <code>NULL</code>, that pointer is considered an end pointer to the position 1 byte past the maximum point in <code>s1</code> beyond which scanning will not continue under any circumstances. (This routine assumes that UTF-8 encoded input strings are not malformed; malformed input can cause it to read past <code>pe1</code>). This means that if both <code>l1</code> and <code>pe1</code> are specified, and <code>pe1</code> is less than <code>s1</code>+<code>l1</code>, the match will never be successful because it can never get as far as its goal (and in fact is asserted against). Correspondingly for <code>pe2</code> with respect to <code>s2</code>.</p>

<p>At least one of <code>s1</code> and <code>s2</code> must have a goal (at least one of <code>l1</code> and <code>l2</code> must be non-zero), and if both do, both have to be reached for a successful match. Also, if the fold of a character is multiple characters, all of them must be matched (see tr21 reference below for &#39;folding&#39;).</p>

<p>Upon a successful match, if <code>pe1</code> is non-<code>NULL</code>, it will be set to point to the beginning of the <i>next</i> character of <code>s1</code> beyond what was matched. Correspondingly for <code>pe2</code> and <code>s2</code>.</p>

<p>For case-insensitiveness, the &quot;casefolding&quot; of Unicode is used instead of upper/lowercasing both the characters, see <a href="https://www.unicode.org/unicode/reports/tr21/">https://www.unicode.org/unicode/reports/tr21/</a> (Case Mappings).</p>

<ul>

<pre><code class="plaintext">I32  foldEQ_utf8(const char *s1, char **pe1, UV l1, bool u1,
                 const char *s2, char **pe2, UV l2, bool u2)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_ascii_string"><a class="permalink" href="perlapi.html#is_ascii_string">#</a><code>is_ascii_string</code> </dt>
<dd>

<p>This is a misleadingly-named synonym for <a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a>. On ASCII-ish platforms, the name isn&#39;t misleading: the ASCII-range characters are exactly the UTF-8 invariants. But EBCDIC machines have more invariants than just the ASCII characters, so <code>is_utf8_invariant_string</code> is preferred.</p>

<ul>

<pre><code class="plaintext">bool  is_ascii_string(const U8* const s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_c9strict_utf8_string"><a class="permalink" href="perlapi.html#is_c9strict_utf8_string">#</a><code>is_c9strict_utf8_string</code> </dt>
<dd>

<p>Returns TRUE if the first <code>len</code> bytes of string <code>s</code> form a valid UTF-8-encoded string that conforms to <a href="http://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a>; otherwise it returns FALSE. If <code>len</code> is 0, it will be calculated using <code>strlen(s)</code> (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte). Note that all characters being ASCII constitute &#39;a valid UTF-8 string&#39;.</p>

<p>This function returns FALSE for strings containing any code points above the Unicode max of 0x10FFFF or surrogate code points, but accepts non-character code points per <a href="http://www.unicode.org/versions/corrigendum9.html">Corrigendum #9</a>.</p>

<p>See also <code><a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_invariant_string_loc">&quot;is_utf8_invariant_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_c9strict_utf8_string(const U8 *s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_c9strict_utf8_string_loc"><a class="permalink" href="perlapi.html#is_c9strict_utf8_string_loc">#</a><code>is_c9strict_utf8_string_loc</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_c9strict_utf8_string_loc(const U8 *s, STRLEN len,
                                  const U8 **ep)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_c9strict_utf8_string_loclen"><a class="permalink" href="perlapi.html#is_c9strict_utf8_string_loclen">#</a><code>is_c9strict_utf8_string_loclen</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer, and the number of UTF-8 encoded characters in the <code>el</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_c9strict_utf8_string_loclen(const U8 *s, STRLEN len,
                                     const U8 **ep, STRLEN *el)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isC9_STRICT_UTF8_CHAR"><a class="permalink" href="perlapi.html#isC9_STRICT_UTF8_CHAR">#</a><code>isC9_STRICT_UTF8_CHAR</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8 that represents some Unicode non-surrogate code point; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation. Any bytes remaining before <code>e</code>, but beyond the ones needed to form the first code point in <code>s</code>, are not examined.</p>

<p>The largest acceptable code point is the Unicode maximum 0x10FFFF. This differs from <code><a href="perlapi.html#isSTRICT_UTF8_CHAR">&quot;isSTRICT_UTF8_CHAR&quot;</a></code> only in that it accepts non-character code points. This corresponds to <a href="http://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a>. which said that non-character code points are merely discouraged rather than completely forbidden in open interchange. See <a href="perlunicode.html#Noncharacter-code-points">&quot;Noncharacter code points&quot; in perlunicode</a>.</p>

<p>Use <code><a href="perlapi.html#isUTF8_CHAR">&quot;isUTF8_CHAR&quot;</a></code> to check for Perl&#39;s extended UTF-8; and <code><a href="perlapi.html#isUTF8_CHAR_flags">&quot;isUTF8_CHAR_flags&quot;</a></code> for a more customized definition.</p>

<p>Use <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code> to check entire strings.</p>

<ul>

<pre><code class="plaintext">Size_t  isC9_STRICT_UTF8_CHAR(const U8 * const s0,
                              const U8 * const e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_invariant_string"><a class="permalink" href="perlapi.html#is_invariant_string">#</a><code>is_invariant_string</code> </dt>
<dd>

<p>This is a somewhat misleadingly-named synonym for <a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a>. <code>is_utf8_invariant_string</code> is preferred, as it indicates under what conditions the string is invariant.</p>

<ul>

<pre><code class="plaintext">bool  is_invariant_string(const U8* const s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isSTRICT_UTF8_CHAR"><a class="permalink" href="perlapi.html#isSTRICT_UTF8_CHAR">#</a><code>isSTRICT_UTF8_CHAR</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8 that represents some Unicode code point completely acceptable for open interchange between all applications; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation. Any bytes remaining before <code>e</code>, but beyond the ones needed to form the first code point in <code>s</code>, are not examined.</p>

<p>The largest acceptable code point is the Unicode maximum 0x10FFFF, and must not be a surrogate nor a non-character code point. Thus this excludes any code point from Perl&#39;s extended UTF-8.</p>

<p>This is used to efficiently decide if the next few bytes in <code>s</code> is legal Unicode-acceptable UTF-8 for a single character.</p>

<p>Use <code><a href="perlapi.html#isC9_STRICT_UTF8_CHAR">&quot;isC9_STRICT_UTF8_CHAR&quot;</a></code> to use the <a href="http://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a> definition of allowable code points; <code><a href="perlapi.html#isUTF8_CHAR">&quot;isUTF8_CHAR&quot;</a></code> to check for Perl&#39;s extended UTF-8; and <code><a href="perlapi.html#isUTF8_CHAR_flags">&quot;isUTF8_CHAR_flags&quot;</a></code> for a more customized definition.</p>

<p>Use <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code> to check entire strings.</p>

<ul>

<pre><code class="plaintext">Size_t  isSTRICT_UTF8_CHAR(const U8 * const s0,
                           const U8 * const e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_strict_utf8_string"><a class="permalink" href="perlapi.html#is_strict_utf8_string">#</a><code>is_strict_utf8_string</code> </dt>
<dd>

<p>Returns TRUE if the first <code>len</code> bytes of string <code>s</code> form a valid UTF-8-encoded string that is fully interchangeable by any application using Unicode rules; otherwise it returns FALSE. If <code>len</code> is 0, it will be calculated using <code>strlen(s)</code> (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte). Note that all characters being ASCII constitute &#39;a valid UTF-8 string&#39;.</p>

<p>This function returns FALSE for strings containing any code points above the Unicode max of 0x10FFFF, surrogate code points, or non-character code points.</p>

<p>See also <code><a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_invariant_string_loc">&quot;is_utf8_invariant_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_strict_utf8_string(const U8 *s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_strict_utf8_string_loc"><a class="permalink" href="perlapi.html#is_strict_utf8_string_loc">#</a><code>is_strict_utf8_string_loc</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_strict_utf8_string_loc(const U8 *s, STRLEN len,
                                const U8 **ep)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_strict_utf8_string_loclen"><a class="permalink" href="perlapi.html#is_strict_utf8_string_loclen">#</a><code>is_strict_utf8_string_loclen</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer, and the number of UTF-8 encoded characters in the <code>el</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_strict_utf8_string_loclen(const U8 *s, STRLEN len,
                                   const U8 **ep, STRLEN *el)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_char"><a class="permalink" href="perlapi.html#is_utf8_char">#</a><code>is_utf8_char</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>is_utf8_char</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Tests if some arbitrary number of bytes begins in a valid UTF-8 character. Note that an INVARIANT (i.e. ASCII on non-EBCDIC machines) character is a valid UTF-8 character. The actual number of bytes in the UTF-8 character will be returned if it is valid, otherwise 0.</p>

<p>This function is deprecated due to the possibility that malformed input could cause reading beyond the end of the input buffer. Use <a href="perlapi.html#isUTF8_CHAR">&quot;isUTF8_CHAR&quot;</a> instead.</p>

<ul>

<pre><code class="plaintext">STRLEN  is_utf8_char(const U8 *s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_char_buf"><a class="permalink" href="perlapi.html#is_utf8_char_buf">#</a><code>is_utf8_char_buf</code> </dt>
<dd>

<p>This is identical to the macro <a href="perlapi.html#isUTF8_CHAR">&quot;isUTF8_CHAR&quot; in perlapi</a>.</p>

<ul>

<pre><code class="plaintext">STRLEN  is_utf8_char_buf(const U8 *buf, const U8 *buf_end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_fixed_width_buf_flags"><a class="permalink" href="perlapi.html#is_utf8_fixed_width_buf_flags">#</a><code>is_utf8_fixed_width_buf_flags</code> </dt>
<dd>

<p>Returns TRUE if the fixed-width buffer starting at <code>s</code> with length <code>len</code> is entirely valid UTF-8, subject to the restrictions given by <code>flags</code>; otherwise it returns FALSE.</p>

<p>If <code>flags</code> is 0, any well-formed UTF-8, as extended by Perl, is accepted without restriction. If the final few bytes of the buffer do not form a complete code point, this will return TRUE anyway, provided that <code><a href="perlapi.html#is_utf8_valid_partial_char_flags">&quot;is_utf8_valid_partial_char_flags&quot;</a></code> returns TRUE for them.</p>

<p>If <code>flags</code> in non-zero, it can be any combination of the <code>UTF8_DISALLOW_<i>foo</i></code> flags accepted by <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code>, and with the same meanings.</p>

<p>This function differs from <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code> only in that the latter returns FALSE if the final few bytes of the string don&#39;t form a complete code point.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_fixed_width_buf_flags(const U8 * const s,
                                    STRLEN len, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_fixed_width_buf_loclen_flags"><a class="permalink" href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">#</a><code>is_utf8_fixed_width_buf_loclen_flags</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code> but stores the number of complete, valid characters found in the <code>el</code> pointer.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_fixed_width_buf_loclen_flags(const U8 * const s,
                                           STRLEN len,
                                           const U8 **ep,
                                           STRLEN *el,
                                           const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_fixed_width_buf_loc_flags"><a class="permalink" href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">#</a><code>is_utf8_fixed_width_buf_loc_flags</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code> but stores the location of the failure in the <code>ep</code> pointer. If the function returns TRUE, <code>*ep</code> will point to the beginning of any partial character at the end of the buffer; if there is no partial character <code>*ep</code> will contain <code>s</code>+<code>len</code>.</p>

<p>See also <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_fixed_width_buf_loc_flags(const U8 * const s,
                                        STRLEN len, const U8 **ep,
                                        const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_invariant_string"><a class="permalink" href="perlapi.html#is_utf8_invariant_string">#</a><code>is_utf8_invariant_string</code> </dt>
<dd>

<p>Returns TRUE if the first <code>len</code> bytes of the string <code>s</code> are the same regardless of the UTF-8 encoding of the string (or UTF-EBCDIC encoding on EBCDIC machines); otherwise it returns FALSE. That is, it returns TRUE if they are UTF-8 invariant. On ASCII-ish machines, all the ASCII characters and only the ASCII characters fit this definition. On EBCDIC machines, the ASCII-range characters are invariant, but so also are the C1 controls.</p>

<p>If <code>len</code> is 0, it will be calculated using <code>strlen(s)</code>, (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte).</p>

<p>See also <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_invariant_string(const U8* const s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_invariant_string_loc"><a class="permalink" href="perlapi.html#is_utf8_invariant_string_loc">#</a><code>is_utf8_invariant_string_loc</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a></code> but upon failure, stores the location of the first UTF-8 variant character in the <code>ep</code> pointer; if all characters are UTF-8 invariant, this function does not change the contents of <code>*ep</code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_invariant_string_loc(const U8* const s, STRLEN len,
                                   const U8 ** ep)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string"><a class="permalink" href="perlapi.html#is_utf8_string">#</a><code>is_utf8_string</code> </dt>
<dd>

<p>Returns TRUE if the first <code>len</code> bytes of string <code>s</code> form a valid Perl-extended-UTF-8 string; returns FALSE otherwise. If <code>len</code> is 0, it will be calculated using <code>strlen(s)</code> (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte). Note that all characters being ASCII constitute &#39;a valid UTF-8 string&#39;.</p>

<p>This function considers Perl&#39;s extended UTF-8 to be valid. That means that code points above Unicode, surrogates, and non-character code points are considered valid by this function. Use <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>, or <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code> to restrict what code points are considered valid.</p>

<p>See also <code><a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_invariant_string_loc">&quot;is_utf8_invariant_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>,</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string(const U8 *s, STRLEN len)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string_flags"><a class="permalink" href="perlapi.html#is_utf8_string_flags">#</a><code>is_utf8_string_flags</code> </dt>
<dd>

<p>Returns TRUE if the first <code>len</code> bytes of string <code>s</code> form a valid UTF-8 string, subject to the restrictions imposed by <code>flags</code>; returns FALSE otherwise. If <code>len</code> is 0, it will be calculated using <code>strlen(s)</code> (which means if you use this option, that <code>s</code> can&#39;t have embedded <code>NUL</code> characters and has to have a terminating <code>NUL</code> byte). Note that all characters being ASCII constitute &#39;a valid UTF-8 string&#39;.</p>

<p>If <code>flags</code> is 0, this gives the same results as <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>; if <code>flags</code> is <code>UTF8_DISALLOW_ILLEGAL_INTERCHANGE</code>, this gives the same results as <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>; and if <code>flags</code> is <code>UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE</code>, this gives the same results as <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>. Otherwise <code>flags</code> may be any combination of the <code>UTF8_DISALLOW_<i>foo</i></code> flags understood by <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code>, with the same meanings.</p>

<p>See also <code><a href="perlapi.html#is_utf8_invariant_string">&quot;is_utf8_invariant_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_invariant_string_loc">&quot;is_utf8_invariant_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_flags">&quot;is_utf8_fixed_width_buf_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loc_flags">&quot;is_utf8_fixed_width_buf_loc_flags&quot;</a></code>, <code><a href="perlapi.html#is_utf8_fixed_width_buf_loclen_flags">&quot;is_utf8_fixed_width_buf_loclen_flags&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string">&quot;is_strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loc">&quot;is_strict_utf8_string_loc&quot;</a></code>, <code><a href="perlapi.html#is_strict_utf8_string_loclen">&quot;is_strict_utf8_string_loclen&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string">&quot;is_c9strict_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_c9strict_utf8_string_loc">&quot;is_c9strict_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_c9strict_utf8_string_loclen">&quot;is_c9strict_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string_flags(const U8 *s, STRLEN len,
                           const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string_loc"><a class="permalink" href="perlapi.html#is_utf8_string_loc">#</a><code>is_utf8_string_loc</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string_loc(const U8 *s, const STRLEN len,
                         const U8 **ep)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string_loclen"><a class="permalink" href="perlapi.html#is_utf8_string_loclen">#</a><code>is_utf8_string_loclen</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer, and the number of UTF-8 encoded characters in the <code>el</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string_loclen(const U8 *s, STRLEN len,
                            const U8 **ep, STRLEN *el)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string_loclen_flags"><a class="permalink" href="perlapi.html#is_utf8_string_loclen_flags">#</a><code>is_utf8_string_loclen_flags</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer, and the number of UTF-8 encoded characters in the <code>el</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string_loclen_flags(const U8 *s, STRLEN len,
                                  const U8 **ep, STRLEN *el,
                                  const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_string_loc_flags"><a class="permalink" href="perlapi.html#is_utf8_string_loc_flags">#</a><code>is_utf8_string_loc_flags</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a></code> but stores the location of the failure (in the case of &quot;utf8ness failure&quot;) or the location <code>s</code>+<code>len</code> (in the case of &quot;utf8ness success&quot;) in the <code>ep</code> pointer.</p>

<p>See also <code><a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_string_loc_flags(const U8 *s, STRLEN len,
                               const U8 **ep, const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_valid_partial_char"><a class="permalink" href="perlapi.html#is_utf8_valid_partial_char">#</a><code>is_utf8_valid_partial_char</code> </dt>
<dd>

<p>Returns 0 if the sequence of bytes starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> is the UTF-8 encoding, as extended by Perl, for one or more code points. Otherwise, it returns 1 if there exists at least one non-empty sequence of bytes that when appended to sequence <code>s</code>, starting at position <code>e</code> causes the entire sequence to be the well-formed UTF-8 of some code point; otherwise returns 0.</p>

<p>In other words this returns TRUE if <code>s</code> points to a partial UTF-8-encoded code point.</p>

<p>This is useful when a fixed-length buffer is being tested for being well-formed UTF-8, but the final few bytes in it don&#39;t comprise a full character; that is, it is split somewhere in the middle of the final code point&#39;s UTF-8 representation. (Presumably when the buffer is refreshed with the next chunk of data, the new first bytes will complete the partial code point.) This function is used to verify that the final bytes in the current buffer are in fact the legal beginning of some code point, so that if they aren&#39;t, the failure can be signalled without having to wait for the next read.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_valid_partial_char(const U8 * const s,
                                 const U8 * const e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_utf8_valid_partial_char_flags"><a class="permalink" href="perlapi.html#is_utf8_valid_partial_char_flags">#</a><code>is_utf8_valid_partial_char_flags</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#is_utf8_valid_partial_char">&quot;is_utf8_valid_partial_char&quot;</a></code>, it returns a boolean giving whether or not the input is a valid UTF-8 encoded partial character, but it takes an extra parameter, <code>flags</code>, which can further restrict which code points are considered valid.</p>

<p>If <code>flags</code> is 0, this behaves identically to <code><a href="perlapi.html#is_utf8_valid_partial_char">&quot;is_utf8_valid_partial_char&quot;</a></code>. Otherwise <code>flags</code> can be any combination of the <code>UTF8_DISALLOW_<i>foo</i></code> flags accepted by <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code>. If there is any sequence of bytes that can complete the input partial character in such a way that a non-prohibited character is formed, the function returns TRUE; otherwise FALSE. Non character code points cannot be determined based on partial character input. But many of the other possible excluded types can be determined from just the first one or two bytes.</p>

<ul>

<pre><code class="plaintext">bool  is_utf8_valid_partial_char_flags(const U8 * const s,
                                       const U8 * const e,
                                       const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isUTF8_CHAR"><a class="permalink" href="perlapi.html#isUTF8_CHAR">#</a><code>isUTF8_CHAR</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8, as extended by Perl, that represents some code point; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation. Any bytes remaining before <code>e</code>, but beyond the ones needed to form the first code point in <code>s</code>, are not examined.</p>

<p>The code point can be any that will fit in an IV on this machine, using Perl&#39;s extension to official UTF-8 to represent those higher than the Unicode maximum of 0x10FFFF. That means that this macro is used to efficiently decide if the next few bytes in <code>s</code> is legal UTF-8 for a single character.</p>

<p>Use <code><a href="perlapi.html#isSTRICT_UTF8_CHAR">&quot;isSTRICT_UTF8_CHAR&quot;</a></code> to restrict the acceptable code points to those defined by Unicode to be fully interchangeable across applications; <code><a href="perlapi.html#isC9_STRICT_UTF8_CHAR">&quot;isC9_STRICT_UTF8_CHAR&quot;</a></code> to use the <a href="http://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a> definition of allowable code points; and <code><a href="perlapi.html#isUTF8_CHAR_flags">&quot;isUTF8_CHAR_flags&quot;</a></code> for a more customized definition.</p>

<p>Use <code><a href="perlapi.html#is_utf8_string">&quot;is_utf8_string&quot;</a></code>, <code><a href="perlapi.html#is_utf8_string_loc">&quot;is_utf8_string_loc&quot;</a></code>, and <code><a href="perlapi.html#is_utf8_string_loclen">&quot;is_utf8_string_loclen&quot;</a></code> to check entire strings.</p>

<p>Note also that a UTF-8 &quot;invariant&quot; character (i.e. ASCII on non-EBCDIC machines) is a valid UTF-8 character.</p>

<ul>

<pre><code class="plaintext">Size_t  isUTF8_CHAR(const U8 * const s0, const U8 * const e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="isUTF8_CHAR_flags"><a class="permalink" href="perlapi.html#isUTF8_CHAR_flags">#</a><code>isUTF8_CHAR_flags</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8, as extended by Perl, that represents some code point, subject to the restrictions given by <code>flags</code>; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation. Any bytes remaining before <code>e</code>, but beyond the ones needed to form the first code point in <code>s</code>, are not examined.</p>

<p>If <code>flags</code> is 0, this gives the same results as <code><a href="perlapi.html#isUTF8_CHAR">&quot;isUTF8_CHAR&quot;</a></code>; if <code>flags</code> is <code>UTF8_DISALLOW_ILLEGAL_INTERCHANGE</code>, this gives the same results as <code><a href="perlapi.html#isSTRICT_UTF8_CHAR">&quot;isSTRICT_UTF8_CHAR&quot;</a></code>; and if <code>flags</code> is <code>UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE</code>, this gives the same results as <code><a href="perlapi.html#isC9_STRICT_UTF8_CHAR">&quot;isC9_STRICT_UTF8_CHAR&quot;</a></code>. Otherwise <code>flags</code> may be any combination of the <code>UTF8_DISALLOW_<i>foo</i></code> flags understood by <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code>, with the same meanings.</p>

<p>The three alternative macros are for the most commonly needed validations; they are likely to run somewhat faster than this more general one, as they can be inlined into your code.</p>

<p>Use <a href="perlapi.html#is_utf8_string_flags">&quot;is_utf8_string_flags&quot;</a>, <a href="perlapi.html#is_utf8_string_loc_flags">&quot;is_utf8_string_loc_flags&quot;</a>, and <a href="perlapi.html#is_utf8_string_loclen_flags">&quot;is_utf8_string_loclen_flags&quot;</a> to check entire strings.</p>

<ul>

<pre><code class="plaintext">STRLEN  isUTF8_CHAR_flags(const U8 *s, const U8 *e,
                          const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="LATIN1_TO_NATIVE"><a class="permalink" href="perlapi.html#LATIN1_TO_NATIVE">#</a><code>LATIN1_TO_NATIVE</code> </dt>
<dd>

<p>Returns the native equivalent of the input Latin-1 code point (including ASCII and control characters) given by <code>ch</code>. Thus, <code>LATIN1_TO_NATIVE(66)</code> on EBCDIC platforms returns 194. These each represent the character <code>&quot;B&quot;</code> on their respective platforms. On ASCII platforms no conversion is needed, so this macro expands to just its input, adding no time nor space requirements to the implementation.</p>

<p>For conversion of code points potentially larger than will fit in a character, use <a href="perlapi.html#UNI_TO_NATIVE">&quot;UNI_TO_NATIVE&quot;</a>.</p>

<ul>

<pre><code class="plaintext">U8  LATIN1_TO_NATIVE(U8 ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="NATIVE_TO_LATIN1"><a class="permalink" href="perlapi.html#NATIVE_TO_LATIN1">#</a><code>NATIVE_TO_LATIN1</code> </dt>
<dd>

<p>Returns the Latin-1 (including ASCII and control characters) equivalent of the input native code point given by <code>ch</code>. Thus, <code>NATIVE_TO_LATIN1(193)</code> on EBCDIC platforms returns 65. These each represent the character <code>&quot;A&quot;</code> on their respective platforms. On ASCII platforms no conversion is needed, so this macro expands to just its input, adding no time nor space requirements to the implementation.</p>

<p>For conversion of code points potentially larger than will fit in a character, use <a href="perlapi.html#NATIVE_TO_UNI">&quot;NATIVE_TO_UNI&quot;</a>.</p>

<ul>

<pre><code class="plaintext">U8  NATIVE_TO_LATIN1(U8 ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="NATIVE_TO_UNI"><a class="permalink" href="perlapi.html#NATIVE_TO_UNI">#</a><code>NATIVE_TO_UNI</code> </dt>
<dd>

<p>Returns the Unicode equivalent of the input native code point given by <code>ch</code>. Thus, <code>NATIVE_TO_UNI(195)</code> on EBCDIC platforms returns 67. These each represent the character <code>&quot;C&quot;</code> on their respective platforms. On ASCII platforms no conversion is needed, so this macro expands to just its input, adding no time nor space requirements to the implementation.</p>

<ul>

<pre><code class="plaintext">UV  NATIVE_TO_UNI(UV ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pad_compname_type"><a class="permalink" href="perlapi.html#pad_compname_type">#</a><code>pad_compname_type</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>pad_compname_type</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Looks up the type of the lexical variable at position <code>po</code> in the currently-compiling pad. If the variable is typed, the stash of the class to which it is typed is returned. If not, <code>NULL</code> is returned.</p>

<p>Use <a href="perlintern.html#PAD_COMPNAME_TYPE">&quot;<code>PAD_COMPNAME_TYPE</code>&quot; in perlintern</a> instead.</p>

<ul>

<pre><code class="plaintext">HV*  pad_compname_type(const PADOFFSET po)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="pv_uni_display"><a class="permalink" href="perlapi.html#pv_uni_display">#</a><code>pv_uni_display</code> </dt>
<dd>

<p>Build to the scalar <code>dsv</code> a displayable version of the UTF-8 encoded string <code>spv</code>, length <code>len</code>, the displayable version being at most <code>pvlim</code> bytes long (if longer, the rest is truncated and <code>&quot;...&quot;</code> will be appended).</p>

<p>The <code>flags</code> argument can have <code>UNI_DISPLAY_ISPRINT</code> set to display <code>isPRINT()</code>able characters as themselves, <code>UNI_DISPLAY_BACKSLASH</code> to display the <code>\\[nrfta\\]</code> as the backslashed versions (like <code>&quot;\n&quot;</code>) (<code>UNI_DISPLAY_BACKSLASH</code> is preferred over <code>UNI_DISPLAY_ISPRINT</code> for <code>&quot;\\&quot;</code>). <code>UNI_DISPLAY_QQ</code> (and its alias <code>UNI_DISPLAY_REGEX</code>) have both <code>UNI_DISPLAY_BACKSLASH</code> and <code>UNI_DISPLAY_ISPRINT</code> turned on.</p>

<p>Additionally, there is now <code>UNI_DISPLAY_BACKSPACE</code> which allows <code>\b</code> for a backspace, but only when <code>UNI_DISPLAY_BACKSLASH</code> also is set.</p>

<p>The pointer to the PV of the <code>dsv</code> is returned.</p>

<p>See also <a href="perlapi.html#sv_uni_display">&quot;sv_uni_display&quot;</a>.</p>

<ul>

<pre><code class="plaintext">char*  pv_uni_display(SV *dsv, const U8 *spv, STRLEN len,
                      STRLEN pvlim, UV flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="REPLACEMENT_CHARACTER_UTF8"><a class="permalink" href="perlapi.html#REPLACEMENT_CHARACTER_UTF8">#</a><code>REPLACEMENT_CHARACTER_UTF8</code> </dt>
<dd>

<p>This is a macro that evaluates to a string constant of the UTF-8 bytes that define the Unicode REPLACEMENT CHARACTER (U+FFFD) for the platform that perl is compiled on. This allows code to use a mnemonic for this character that works on both ASCII and EBCDIC platforms. <span style="white-space: nowrap;"><code>sizeof(REPLACEMENT_CHARACTER_UTF8) - 1</code></span> can be used to get its length in bytes.</p>

</dd>
</dl>

<dl>

<dt id="sv_cat_decode"><a class="permalink" href="perlapi.html#sv_cat_decode">#</a><code>sv_cat_decode</code> </dt>
<dd>

<p><code>encoding</code> is assumed to be an <code>Encode</code> object, the PV of <code>ssv</code> is assumed to be octets in that encoding and decoding the input starts from the position which <span style="white-space: nowrap;"><code>(PV + *offset)</code></span> pointed to. <code>dsv</code> will be concatenated with the decoded UTF-8 string from <code>ssv</code>. Decoding will terminate when the string <code>tstr</code> appears in decoding output or the input ends on the PV of <code>ssv</code>. The value which <code>offset</code> points will be modified to the last input position on <code>ssv</code>.</p>

<p>Returns TRUE if the terminator was found, else returns FALSE.</p>

<ul>

<pre><code class="plaintext">bool  sv_cat_decode(SV* dsv, SV *encoding, SV *ssv, int *offset,
                    char* tstr, int tlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_recode_to_utf8"><a class="permalink" href="perlapi.html#sv_recode_to_utf8">#</a><code>sv_recode_to_utf8</code> </dt>
<dd>

<p><code>encoding</code> is assumed to be an <code>Encode</code> object, on entry the PV of <code>sv</code> is assumed to be octets in that encoding, and <code>sv</code> will be converted into Unicode (and UTF-8).</p>

<p>If <code>sv</code> already is UTF-8 (or if it is not <code>POK</code>), or if <code>encoding</code> is not a reference, nothing is done to <code>sv</code>. If <code>encoding</code> is not an <code>Encode::XS</code> Encoding object, bad things will happen. (See <i>cpan/Encode/encoding.pm</i> and <a href="Encode.html">Encode</a>.)</p>

<p>The PV of <code>sv</code> is returned.</p>

<ul>

<pre><code class="plaintext">char*  sv_recode_to_utf8(SV* sv, SV *encoding)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_uni_display"><a class="permalink" href="perlapi.html#sv_uni_display">#</a><code>sv_uni_display</code> </dt>
<dd>

<p>Build to the scalar <code>dsv</code> a displayable version of the scalar <code>sv</code>, the displayable version being at most <code>pvlim</code> bytes long (if longer, the rest is truncated and &quot;...&quot; will be appended).</p>

<p>The <code>flags</code> argument is as in <a href="perlapi.html#pv_uni_display">&quot;pv_uni_display&quot;</a>().</p>

<p>The pointer to the PV of the <code>dsv</code> is returned.</p>

<ul>

<pre><code class="plaintext">char*  sv_uni_display(SV *dsv, SV *ssv, STRLEN pvlim, UV flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UNICODE_REPLACEMENT"><a class="permalink" href="perlapi.html#UNICODE_REPLACEMENT">#</a><code>UNICODE_REPLACEMENT</code> </dt>
<dd>

<p>Evaluates to 0xFFFD, the code point of the Unicode REPLACEMENT CHARACTER</p>

</dd>
</dl>

<dl>

<dt id="UNI_TO_NATIVE"><a class="permalink" href="perlapi.html#UNI_TO_NATIVE">#</a><code>UNI_TO_NATIVE</code> </dt>
<dd>

<p>Returns the native equivalent of the input Unicode code point given by <code>ch</code>. Thus, <code>UNI_TO_NATIVE(68)</code> on EBCDIC platforms returns 196. These each represent the character <code>&quot;D&quot;</code> on their respective platforms. On ASCII platforms no conversion is needed, so this macro expands to just its input, adding no time nor space requirements to the implementation.</p>

<ul>

<pre><code class="plaintext">UV  UNI_TO_NATIVE(UV ch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8n_to_uvchr"><a class="permalink" href="perlapi.html#utf8n_to_uvchr">#</a><code>utf8n_to_uvchr</code> </dt>
<dd>

<p>THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES. Most code should use <a href="perlapi.html#utf8_to_uvchr_buf">&quot;utf8_to_uvchr_buf&quot;</a>() rather than call this directly.</p>

<p>Bottom level UTF-8 decode routine. Returns the native code point value of the first character in the string <code>s</code>, which is assumed to be in UTF-8 (or UTF-EBCDIC) encoding, and no longer than <code>curlen</code> bytes; <code>*retlen</code> (if <code>retlen</code> isn&#39;t NULL) will be set to the length, in bytes, of that character.</p>

<p>The value of <code>flags</code> determines the behavior when <code>s</code> does not point to a well-formed UTF-8 character. If <code>flags</code> is 0, encountering a malformation causes zero to be returned and <code>*retlen</code> is set so that (<span style="white-space: nowrap;"><code>s</code> + <code>*retlen</code></span>) is the next possible position in <code>s</code> that could begin a non-malformed character. Also, if UTF-8 warnings haven&#39;t been lexically disabled, a warning is raised. Some UTF-8 input sequences may contain multiple malformations. This function tries to find every possible one in each call, so multiple warnings can be raised for the same sequence.</p>

<p>Various ALLOW flags can be set in <code>flags</code> to allow (and not warn on) individual types of malformations, such as the sequence being overlong (that is, when there is a shorter sequence that can express the same code point; overlong sequences are expressly forbidden in the UTF-8 standard due to potential security issues). Another malformation example is the first byte of a character not being a legal first byte. See <i>utf8.h</i> for the list of such flags. Even if allowed, this function generally returns the Unicode REPLACEMENT CHARACTER when it encounters a malformation. There are flags in <i>utf8.h</i> to override this behavior for the overlong malformations, but don&#39;t do that except for very specialized purposes.</p>

<p>The <code>UTF8_CHECK_ONLY</code> flag overrides the behavior when a non-allowed (by other flags) malformation is found. If this flag is set, the routine assumes that the caller will raise a warning, and this function will silently just set <code>retlen</code> to <code>-1</code> (cast to <code>STRLEN</code>) and return zero.</p>

<p>Note that this API requires disambiguation between successful decoding a <code>NUL</code> character, and an error return (unless the <code>UTF8_CHECK_ONLY</code> flag is set), as in both cases, 0 is returned, and, depending on the malformation, <code>retlen</code> may be set to 1. To disambiguate, upon a zero return, see if the first byte of <code>s</code> is 0 as well. If so, the input was a <code>NUL</code>; if not, the input had an error. Or you can use <code><a href="perlapi.html#utf8n_to_uvchr_error">&quot;utf8n_to_uvchr_error&quot;</a></code>.</p>

<p>Certain code points are considered problematic. These are Unicode surrogates, Unicode non-characters, and code points above the Unicode maximum of 0x10FFFF. By default these are considered regular code points, but certain situations warrant special handling for them, which can be specified using the <code>flags</code> parameter. If <code>flags</code> contains <code>UTF8_DISALLOW_ILLEGAL_INTERCHANGE</code>, all three classes are treated as malformations and handled as such. The flags <code>UTF8_DISALLOW_SURROGATE</code>, <code>UTF8_DISALLOW_NONCHAR</code>, and <code>UTF8_DISALLOW_SUPER</code> (meaning above the legal Unicode maximum) can be set to disallow these categories individually. <code>UTF8_DISALLOW_ILLEGAL_INTERCHANGE</code> restricts the allowed inputs to the strict UTF-8 traditionally defined by Unicode. Use <code>UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE</code> to use the strictness definition given by <a href="https://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a>. The difference between traditional strictness and C9 strictness is that the latter does not forbid non-character code points. (They are still discouraged, however.) For more discussion see <a href="perlunicode.html#Noncharacter-code-points">&quot;Noncharacter code points&quot; in perlunicode</a>.</p>

<p>The flags <code>UTF8_WARN_ILLEGAL_INTERCHANGE</code>, <code>UTF8_WARN_ILLEGAL_C9_INTERCHANGE</code>, <code>UTF8_WARN_SURROGATE</code>, <code>UTF8_WARN_NONCHAR</code>, and <code>UTF8_WARN_SUPER</code> will cause warning messages to be raised for their respective categories, but otherwise the code points are considered valid (not malformations). To get a category to both be treated as a malformation and raise a warning, specify both the WARN and DISALLOW flags. (But note that warnings are not raised if lexically disabled nor if <code>UTF8_CHECK_ONLY</code> is also specified.)</p>

<p>Extremely high code points were never specified in any standard, and require an extension to UTF-8 to express, which Perl does. It is likely that programs written in something other than Perl would not be able to read files that contain these; nor would Perl understand files written by something that uses a different extension. For these reasons, there is a separate set of flags that can warn and/or disallow these extremely high code points, even if other above-Unicode ones are accepted. They are the <code>UTF8_WARN_PERL_EXTENDED</code> and <code>UTF8_DISALLOW_PERL_EXTENDED</code> flags. For more information see <code><a href="perlapi.html#UTF8_GOT_PERL_EXTENDED">&quot;UTF8_GOT_PERL_EXTENDED&quot;</a></code>. Of course <code>UTF8_DISALLOW_SUPER</code> will treat all above-Unicode code points, including these, as malformations. (Note that the Unicode standard considers anything above 0x10FFFF to be illegal, but there are standards predating it that allow up to 0x7FFF_FFFF (2**31 -1))</p>

<p>A somewhat misleadingly named synonym for <code>UTF8_WARN_PERL_EXTENDED</code> is retained for backward compatibility: <code>UTF8_WARN_ABOVE_31_BIT</code>. Similarly, <code>UTF8_DISALLOW_ABOVE_31_BIT</code> is usable instead of the more accurately named <code>UTF8_DISALLOW_PERL_EXTENDED</code>. The names are misleading because these flags can apply to code points that actually do fit in 31 bits. This happens on EBCDIC platforms, and sometimes when the <a href="perlapi.html#UTF8_GOT_LONG">overlong malformation</a> is also present. The new names accurately describe the situation in all cases.</p>

<p>All other code points corresponding to Unicode characters, including private use and those yet to be assigned, are never considered malformed and never warn.</p>

<ul>

<pre><code class="plaintext">UV  utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN *retlen,
                   const U32 flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8n_to_uvchr_error"><a class="permalink" href="perlapi.html#utf8n_to_uvchr_error">#</a><code>utf8n_to_uvchr_error</code> </dt>
<dd>

<p>THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES. Most code should use <a href="perlapi.html#utf8_to_uvchr_buf">&quot;utf8_to_uvchr_buf&quot;</a>() rather than call this directly.</p>

<p>This function is for code that needs to know what the precise malformation(s) are when an error is found. If you also need to know the generated warning messages, use <a href="perlapi.html#utf8n_to_uvchr_msgs">&quot;utf8n_to_uvchr_msgs&quot;</a>() instead.</p>

<p>It is like <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code> but it takes an extra parameter placed after all the others, <code>errors</code>. If this parameter is 0, this function behaves identically to <code><a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a></code>. Otherwise, <code>errors</code> should be a pointer to a <code>U32</code> variable, which this function sets to indicate any errors found. Upon return, if <code>*errors</code> is 0, there were no errors found. Otherwise, <code>*errors</code> is the bit-wise <code>OR</code> of the bits described in the list below. Some of these bits will be set if a malformation is found, even if the input <code>flags</code> parameter indicates that the given malformation is allowed; those exceptions are noted:</p>

<dl>

<dt id="UTF8_GOT_PERL_EXTENDED"><a class="permalink" href="perlapi.html#UTF8_GOT_PERL_EXTENDED">#</a><code>UTF8_GOT_PERL_EXTENDED</code></dt>
<dd>

<p>The input sequence is not standard UTF-8, but a Perl extension. This bit is set only if the input <code>flags</code> parameter contains either the <code>UTF8_DISALLOW_PERL_EXTENDED</code> or the <code>UTF8_WARN_PERL_EXTENDED</code> flags.</p>

<p>Code points above 0x7FFF_FFFF (2**31 - 1) were never specified in any standard, and so some extension must be used to express them. Perl uses a natural extension to UTF-8 to represent the ones up to 2**36-1, and invented a further extension to represent even higher ones, so that any code point that fits in a 64-bit word can be represented. Text using these extensions is not likely to be portable to non-Perl code. We lump both of these extensions together and refer to them as Perl extended UTF-8. There exist other extensions that people have invented, incompatible with Perl&#39;s.</p>

<p>On EBCDIC platforms starting in Perl v5.24, the Perl extension for representing extremely high code points kicks in at 0x3FFF_FFFF (2**30 -1), which is lower than on ASCII. Prior to that, code points 2**31 and higher were simply unrepresentable, and a different, incompatible method was used to represent code points between 2**30 and 2**31 - 1.</p>

<p>On both platforms, ASCII and EBCDIC, <code>UTF8_GOT_PERL_EXTENDED</code> is set if Perl extended UTF-8 is used.</p>

<p>In earlier Perls, this bit was named <code>UTF8_GOT_ABOVE_31_BIT</code>, which you still may use for backward compatibility. That name is misleading, as this flag may be set when the code point actually does fit in 31 bits. This happens on EBCDIC platforms, and sometimes when the <a href="perlapi.html#UTF8_GOT_LONG">overlong malformation</a> is also present. The new name accurately describes the situation in all cases.</p>

</dd>
<dt id="UTF8_GOT_CONTINUATION"><a class="permalink" href="perlapi.html#UTF8_GOT_CONTINUATION">#</a><code>UTF8_GOT_CONTINUATION</code></dt>
<dd>

<p>The input sequence was malformed in that the first byte was a UTF-8 continuation byte.</p>

</dd>
<dt id="UTF8_GOT_EMPTY"><a class="permalink" href="perlapi.html#UTF8_GOT_EMPTY">#</a><code>UTF8_GOT_EMPTY</code></dt>
<dd>

<p>The input <code>curlen</code> parameter was 0.</p>

</dd>
<dt id="UTF8_GOT_LONG"><a class="permalink" href="perlapi.html#UTF8_GOT_LONG">#</a><code>UTF8_GOT_LONG</code></dt>
<dd>

<p>The input sequence was malformed in that there is some other sequence that evaluates to the same code point, but that sequence is shorter than this one.</p>

<p>Until Unicode 3.1, it was legal for programs to accept this malformation, but it was discovered that this created security issues.</p>

</dd>
<dt id="UTF8_GOT_NONCHAR"><a class="permalink" href="perlapi.html#UTF8_GOT_NONCHAR">#</a><code>UTF8_GOT_NONCHAR</code></dt>
<dd>

<p>The code point represented by the input UTF-8 sequence is for a Unicode non-character code point. This bit is set only if the input <code>flags</code> parameter contains either the <code>UTF8_DISALLOW_NONCHAR</code> or the <code>UTF8_WARN_NONCHAR</code> flags.</p>

</dd>
<dt id="UTF8_GOT_NON_CONTINUATION"><a class="permalink" href="perlapi.html#UTF8_GOT_NON_CONTINUATION">#</a><code>UTF8_GOT_NON_CONTINUATION</code></dt>
<dd>

<p>The input sequence was malformed in that a non-continuation type byte was found in a position where only a continuation type one should be. See also <code><a href="perlapi.html#UTF8_GOT_SHORT">&quot;UTF8_GOT_SHORT&quot;</a></code>.</p>

</dd>
<dt id="UTF8_GOT_OVERFLOW"><a class="permalink" href="perlapi.html#UTF8_GOT_OVERFLOW">#</a><code>UTF8_GOT_OVERFLOW</code></dt>
<dd>

<p>The input sequence was malformed in that it is for a code point that is not representable in the number of bits available in an IV on the current platform.</p>

</dd>
<dt id="UTF8_GOT_SHORT"><a class="permalink" href="perlapi.html#UTF8_GOT_SHORT">#</a><code>UTF8_GOT_SHORT</code></dt>
<dd>

<p>The input sequence was malformed in that <code>curlen</code> is smaller than required for a complete sequence. In other words, the input is for a partial character sequence.</p>

<p><code>UTF8_GOT_SHORT</code> and <code>UTF8_GOT_NON_CONTINUATION</code> both indicate a too short sequence. The difference is that <code>UTF8_GOT_NON_CONTINUATION</code> indicates always that there is an error, while <code>UTF8_GOT_SHORT</code> means that an incomplete sequence was looked at. If no other flags are present, it means that the sequence was valid as far as it went. Depending on the application, this could mean one of three things:</p>

<ul>

<li><p>The <code>curlen</code> length parameter passed in was too small, and the function was prevented from examining all the necessary bytes.</p>

</li>
<li><p>The buffer being looked at is based on reading data, and the data received so far stopped in the middle of a character, so that the next read will read the remainder of this character. (It is up to the caller to deal with the split bytes somehow.)</p>

</li>
<li><p>This is a real error, and the partial sequence is all we&#39;re going to get.</p>

</li>
</ul>

</dd>
<dt id="UTF8_GOT_SUPER"><a class="permalink" href="perlapi.html#UTF8_GOT_SUPER">#</a><code>UTF8_GOT_SUPER</code></dt>
<dd>

<p>The input sequence was malformed in that it is for a non-Unicode code point; that is, one above the legal Unicode maximum. This bit is set only if the input <code>flags</code> parameter contains either the <code>UTF8_DISALLOW_SUPER</code> or the <code>UTF8_WARN_SUPER</code> flags.</p>

</dd>
<dt id="UTF8_GOT_SURROGATE"><a class="permalink" href="perlapi.html#UTF8_GOT_SURROGATE">#</a><code>UTF8_GOT_SURROGATE</code></dt>
<dd>

<p>The input sequence was malformed in that it is for a -Unicode UTF-16 surrogate code point. This bit is set only if the input <code>flags</code> parameter contains either the <code>UTF8_DISALLOW_SURROGATE</code> or the <code>UTF8_WARN_SURROGATE</code> flags.</p>

</dd>
</dl>

<p>To do your own error handling, call this function with the <code>UTF8_CHECK_ONLY</code> flag to suppress any warnings, and then examine the <code>*errors</code> return.</p>

<ul>

<pre><code class="plaintext">UV  utf8n_to_uvchr_error(const U8 *s, STRLEN curlen,
                         STRLEN *retlen, const U32 flags,
                         U32 * errors)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8n_to_uvchr_msgs"><a class="permalink" href="perlapi.html#utf8n_to_uvchr_msgs">#</a><code>utf8n_to_uvchr_msgs</code> </dt>
<dd>

<p>THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES. Most code should use <a href="perlapi.html#utf8_to_uvchr_buf">&quot;utf8_to_uvchr_buf&quot;</a>() rather than call this directly.</p>

<p>This function is for code that needs to know what the precise malformation(s) are when an error is found, and wants the corresponding warning and/or error messages to be returned to the caller rather than be displayed. All messages that would have been displayed if all lexical warnings are enabled will be returned.</p>

<p>It is just like <code><a href="perlapi.html#utf8n_to_uvchr_error">&quot;utf8n_to_uvchr_error&quot;</a></code> but it takes an extra parameter placed after all the others, <code>msgs</code>. If this parameter is 0, this function behaves identically to <code><a href="perlapi.html#utf8n_to_uvchr_error">&quot;utf8n_to_uvchr_error&quot;</a></code>. Otherwise, <code>msgs</code> should be a pointer to an <code>AV *</code> variable, in which this function creates a new AV to contain any appropriate messages. The elements of the array are ordered so that the first message that would have been displayed is in the 0th element, and so on. Each element is a hash with three key-value pairs, as follows:</p>

<dl>

<dt id="text"><a class="permalink" href="perlapi.html#text">#</a><code>text</code></dt>
<dd>

<p>The text of the message as a <code>SVpv</code>.</p>

</dd>
<dt id="warn_categories"><a class="permalink" href="perlapi.html#warn_categories">#</a><code>warn_categories</code></dt>
<dd>

<p>The warning category (or categories) packed into a <code>SVuv</code>.</p>

</dd>
<dt id="flag"><a class="permalink" href="perlapi.html#flag">#</a><code>flag</code></dt>
<dd>

<p>A single flag bit associated with this message, in a <code>SVuv</code>. The bit corresponds to some bit in the <code>*errors</code> return value, such as <code>UTF8_GOT_LONG</code>.</p>

</dd>
</dl>

<p>It&#39;s important to note that specifying this parameter as non-null will cause any warnings this function would otherwise generate to be suppressed, and instead be placed in <code>*msgs</code>. The caller can check the lexical warnings state (or not) when choosing what to do with the returned messages.</p>

<p>If the flag <code>UTF8_CHECK_ONLY</code> is passed, no warnings are generated, and hence no AV is created.</p>

<p>The caller, of course, is responsible for freeing any returned AV.</p>

<ul>

<pre><code class="plaintext">UV  utf8n_to_uvchr_msgs(const U8 *s, STRLEN curlen,
                        STRLEN *retlen, const U32 flags,
                        U32 * errors, AV ** msgs)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8SKIP"><a class="permalink" href="perlapi.html#UTF8SKIP">#</a><code>UTF8SKIP</code> </dt>
<dd>

<p>returns the number of bytes a non-malformed UTF-8 encoded character whose first (perhaps only) byte is pointed to by <code>s</code>.</p>

<p>If there is a possibility of malformed input, use instead:</p>

<dl>

<dt id="&quot;UTF8_SAFE_SKIP&quot;-if-you-know-the-maximum-ending-pointer-in-the-buffer-pointed-to-by-s;-or"><a class="permalink" href="perlapi.html#%22UTF8_SAFE_SKIP%22-if-you-know-the-maximum-ending-pointer-in-the-buffer-pointed-to-by-s;-or">#</a><a id="UTF8_SAFE_SKIP-if-you-know-the-maximum-ending-pointer-in-the-buffer-pointed-to-by-s-or"></a><code><a href="perlapi.html#UTF8_SAFE_SKIP">&quot;UTF8_SAFE_SKIP&quot;</a></code> if you know the maximum ending pointer in the buffer pointed to by <code>s</code>; or</dt>
<dd>

</dd>
<dt id="&quot;UTF8_CHK_SKIP&quot;-if-you-don&#39;t-know-it."><a class="permalink" href="perlapi.html#%22UTF8_CHK_SKIP%22-if-you-don&#39;t-know-it.">#</a><a id="UTF8_CHK_SKIP-if-you-dont-know-it"></a><code><a href="perlapi.html#UTF8_CHK_SKIP">&quot;UTF8_CHK_SKIP&quot;</a></code> if you don&#39;t know it.</dt>
<dd>

</dd>
</dl>

<p>It is better to restructure your code so the end pointer is passed down so that you know what it actually is at the point of this call, but if that isn&#39;t possible, <code><a href="perlapi.html#UTF8_CHK_SKIP">&quot;UTF8_CHK_SKIP&quot;</a></code> can minimize the chance of accessing beyond the end of the input buffer.</p>

<ul>

<pre><code class="plaintext">STRLEN  UTF8SKIP(char* s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_CHK_SKIP"><a class="permalink" href="perlapi.html#UTF8_CHK_SKIP">#</a><code>UTF8_CHK_SKIP</code> </dt>
<dd>

<p>This is a safer version of <code><a href="perlapi.html#UTF8SKIP">&quot;UTF8SKIP&quot;</a></code>, but still not as safe as <code><a href="perlapi.html#UTF8_SAFE_SKIP">&quot;UTF8_SAFE_SKIP&quot;</a></code>. This version doesn&#39;t blindly assume that the input string pointed to by <code>s</code> is well-formed, but verifies that there isn&#39;t a NUL terminating character before the expected end of the next character in <code>s</code>. The length <code>UTF8_CHK_SKIP</code> returns stops just before any such NUL.</p>

<p>Perl tends to add NULs, as an insurance policy, after the end of strings in SV&#39;s, so it is likely that using this macro will prevent inadvertent reading beyond the end of the input buffer, even if it is malformed UTF-8.</p>

<p>This macro is intended to be used by XS modules where the inputs could be malformed, and it isn&#39;t feasible to restructure to use the safer <code><a href="perlapi.html#UTF8_SAFE_SKIP">&quot;UTF8_SAFE_SKIP&quot;</a></code>, for example when interfacing with a C library.</p>

<ul>

<pre><code class="plaintext">STRLEN  UTF8_CHK_SKIP(char* s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_distance"><a class="permalink" href="perlapi.html#utf8_distance">#</a><code>utf8_distance</code> </dt>
<dd>

<p>Returns the number of UTF-8 characters between the UTF-8 pointers <code>a</code> and <code>b</code>.</p>

<p>WARNING: use only if you *know* that the pointers point inside the same UTF-8 buffer.</p>

<ul>

<pre><code class="plaintext">IV  utf8_distance(const U8 *a, const U8 *b)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_hop"><a class="permalink" href="perlapi.html#utf8_hop">#</a><code>utf8_hop</code> </dt>
<dd>

<p>Return the UTF-8 pointer <code>s</code> displaced by <code>off</code> characters, either forward or backward.</p>

<p>WARNING: do not use the following unless you *know* <code>off</code> is within the UTF-8 data pointed to by <code>s</code> *and* that on entry <code>s</code> is aligned on the first byte of character or just after the last byte of a character.</p>

<ul>

<pre><code class="plaintext">U8*  utf8_hop(const U8 *s, SSize_t off)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_hop_back"><a class="permalink" href="perlapi.html#utf8_hop_back">#</a><code>utf8_hop_back</code> </dt>
<dd>

<p>Return the UTF-8 pointer <code>s</code> displaced by up to <code>off</code> characters, backward.</p>

<p><code>off</code> must be non-positive.</p>

<p><code>s</code> must be after or equal to <code>start</code>.</p>

<p>When moving backward it will not move before <code>start</code>.</p>

<p>Will not exceed this limit even if the string is not valid &quot;UTF-8&quot;.</p>

<ul>

<pre><code class="plaintext">U8*  utf8_hop_back(const U8 *s, SSize_t off, const U8 *start)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_hop_forward"><a class="permalink" href="perlapi.html#utf8_hop_forward">#</a><code>utf8_hop_forward</code> </dt>
<dd>

<p>Return the UTF-8 pointer <code>s</code> displaced by up to <code>off</code> characters, forward.</p>

<p><code>off</code> must be non-negative.</p>

<p><code>s</code> must be before or equal to <code>end</code>.</p>

<p>When moving forward it will not move beyond <code>end</code>.</p>

<p>Will not exceed this limit even if the string is not valid &quot;UTF-8&quot;.</p>

<ul>

<pre><code class="plaintext">U8*  utf8_hop_forward(const U8 *s, SSize_t off, const U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_hop_safe"><a class="permalink" href="perlapi.html#utf8_hop_safe">#</a><code>utf8_hop_safe</code> </dt>
<dd>

<p>Return the UTF-8 pointer <code>s</code> displaced by up to <code>off</code> characters, either forward or backward.</p>

<p>When moving backward it will not move before <code>start</code>.</p>

<p>When moving forward it will not move beyond <code>end</code>.</p>

<p>Will not exceed those limits even if the string is not valid &quot;UTF-8&quot;.</p>

<ul>

<pre><code class="plaintext">U8*  utf8_hop_safe(const U8 *s, SSize_t off, const U8 *start,
                   const U8 *end)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_IS_INVARIANT"><a class="permalink" href="perlapi.html#UTF8_IS_INVARIANT">#</a><code>UTF8_IS_INVARIANT</code> </dt>
<dd>

<p>Evaluates to 1 if the byte <code>c</code> represents the same character when encoded in UTF-8 as when not; otherwise evaluates to 0. UTF-8 invariant characters can be copied as-is when converting to/from UTF-8, saving time.</p>

<p>In spite of the name, this macro gives the correct result if the input string from which <code>c</code> comes is not encoded in UTF-8.</p>

<p>See <code><a href="perlapi.html#UVCHR_IS_INVARIANT">&quot;UVCHR_IS_INVARIANT&quot;</a></code> for checking if a UV is invariant.</p>

<ul>

<pre><code class="plaintext">bool  UTF8_IS_INVARIANT(char c)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_IS_NONCHAR"><a class="permalink" href="perlapi.html#UTF8_IS_NONCHAR">#</a><code>UTF8_IS_NONCHAR</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8 that represents one of the Unicode non-character code points; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation.</p>

<ul>

<pre><code class="plaintext">bool  UTF8_IS_NONCHAR(const U8 *s, const U8 *e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_IS_SUPER"><a class="permalink" href="perlapi.html#UTF8_IS_SUPER">#</a><code>UTF8_IS_SUPER</code> </dt>
<dd>

<p>Recall that Perl recognizes an extension to UTF-8 that can encode code points larger than the ones defined by Unicode, which are 0..0x10FFFF.</p>

<p>This macro evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are from this UTF-8 extension; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation.</p>

<p>0 is returned if the bytes are not well-formed extended UTF-8, or if they represent a code point that cannot fit in a UV on the current platform. Hence this macro can give different results when run on a 64-bit word machine than on one with a 32-bit word size.</p>

<p>Note that it is illegal to have code points that are larger than what can fit in an IV on the current machine.</p>

<ul>

<pre><code class="plaintext">bool  UTF8_IS_SUPER(const U8 *s, const U8 *e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_IS_SURROGATE"><a class="permalink" href="perlapi.html#UTF8_IS_SURROGATE">#</a><code>UTF8_IS_SURROGATE</code> </dt>
<dd>

<p>Evaluates to non-zero if the first few bytes of the string starting at <code>s</code> and looking no further than <span style="white-space: nowrap;"><code>e - 1</code></span> are well-formed UTF-8 that represents one of the Unicode surrogate code points; otherwise it evaluates to 0. If non-zero, the value gives how many bytes starting at <code>s</code> comprise the code point&#39;s representation.</p>

<ul>

<pre><code class="plaintext">bool  UTF8_IS_SURROGATE(const U8 *s, const U8 *e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_length"><a class="permalink" href="perlapi.html#utf8_length">#</a><code>utf8_length</code> </dt>
<dd>

<p>Returns the number of characters in the sequence of UTF-8-encoded bytes starting at <code>s</code> and ending at the byte just before <code>e</code>. If &lt;s&gt; and &lt;e&gt; point to the same place, it returns 0 with no warning raised.</p>

<p>If <code>e &lt; s</code> or if the scan would end up past <code>e</code>, it raises a UTF8 warning and returns the number of valid characters.</p>

<ul>

<pre><code class="plaintext">STRLEN  utf8_length(const U8* s, const U8 *e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_MAXBYTES"><a class="permalink" href="perlapi.html#UTF8_MAXBYTES">#</a><code>UTF8_MAXBYTES</code> </dt>
<dd>

<p>The maximum width of a single UTF-8 encoded character, in bytes.</p>

<p>NOTE: Strictly speaking Perl&#39;s UTF-8 should not be called UTF-8 since UTF-8 is an encoding of Unicode, and Unicode&#39;s upper limit, 0x10FFFF, can be expressed with 4 bytes. However, Perl thinks of UTF-8 as a way to encode non-negative integers in a binary format, even those above Unicode.</p>

</dd>
</dl>

<dl>

<dt id="UTF8_MAXBYTES_CASE"><a class="permalink" href="perlapi.html#UTF8_MAXBYTES_CASE">#</a><code>UTF8_MAXBYTES_CASE</code> </dt>
<dd>

<p>The maximum number of UTF-8 bytes a single Unicode character can uppercase/lowercase/titlecase/fold into.</p>

</dd>
</dl>

<dl>

<dt id="UTF8_SAFE_SKIP"><a class="permalink" href="perlapi.html#UTF8_SAFE_SKIP">#</a><code>UTF8_SAFE_SKIP</code> </dt>
<dd>

<p>returns 0 if <span style="white-space: nowrap;"><code>s &gt;= e</code></span>; otherwise returns the number of bytes in the UTF-8 encoded character whose first byte is pointed to by <code>s</code>. But it never returns beyond <code>e</code>. On DEBUGGING builds, it asserts that <span style="white-space: nowrap;"><code>s &lt;= e</code></span>.</p>

<ul>

<pre><code class="plaintext">STRLEN  UTF8_SAFE_SKIP(char* s, char* e)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UTF8_SKIP"><a class="permalink" href="perlapi.html#UTF8_SKIP">#</a><code>UTF8_SKIP</code> </dt>
<dd>

<p>This is a synonym for <code><a href="perlapi.html#UTF8SKIP">&quot;UTF8SKIP&quot;</a></code></p>

<ul>

<pre><code class="plaintext">STRLEN  UTF8_SKIP(char* s)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_to_bytes"><a class="permalink" href="perlapi.html#utf8_to_bytes">#</a><code>utf8_to_bytes</code> </dt>
<dd>

<p>NOTE: <code>utf8_to_bytes</code> is <b>experimental</b> and may change or be removed without notice.</p>

<p>Converts a string <code>&quot;s&quot;</code> of length <code>*lenp</code> from UTF-8 into native byte encoding. Unlike <a href="perlapi.html#bytes_to_utf8">&quot;bytes_to_utf8&quot;</a>, this over-writes the original string, and updates <code>*lenp</code> to contain the new length. Returns zero on failure (leaving <code>&quot;s&quot;</code> unchanged) setting <code>*lenp</code> to -1.</p>

<p>Upon successful return, the number of variants in the string can be computed by having saved the value of <code>*lenp</code> before the call, and subtracting the after-call value of <code>*lenp</code> from it.</p>

<p>If you need a copy of the string, see <a href="perlapi.html#bytes_from_utf8">&quot;bytes_from_utf8&quot;</a>.</p>

<ul>

<pre><code class="plaintext">U8*  utf8_to_bytes(U8 *s, STRLEN *lenp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_to_uvchr"><a class="permalink" href="perlapi.html#utf8_to_uvchr">#</a><code>utf8_to_uvchr</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>utf8_to_uvchr</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>Returns the native code point of the first character in the string <code>s</code> which is assumed to be in UTF-8 encoding; <code>retlen</code> will be set to the length, in bytes, of that character.</p>

<p>Some, but not all, UTF-8 malformations are detected, and in fact, some malformed input could cause reading beyond the end of the input buffer, which is why this function is deprecated. Use <a href="perlapi.html#utf8_to_uvchr_buf">&quot;utf8_to_uvchr_buf&quot;</a> instead.</p>

<p>If <code>s</code> points to one of the detected malformations, and UTF8 warnings are enabled, zero is returned and <code>*retlen</code> is set (if <code>retlen</code> isn&#39;t <code>NULL</code>) to -1. If those warnings are off, the computed value if well-defined (or the Unicode REPLACEMENT CHARACTER, if not) is silently returned, and <code>*retlen</code> is set (if <code>retlen</code> isn&#39;t NULL) so that (<span style="white-space: nowrap;"><code>s</code> + <code>*retlen</code></span>) is the next possible position in <code>s</code> that could begin a non-malformed character. See <a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a> for details on when the REPLACEMENT CHARACTER is returned.</p>

<ul>

<pre><code class="plaintext">UV  utf8_to_uvchr(const U8 *s, STRLEN *retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="utf8_to_uvchr_buf"><a class="permalink" href="perlapi.html#utf8_to_uvchr_buf">#</a><code>utf8_to_uvchr_buf</code> </dt>
<dd>

<p>Returns the native code point of the first character in the string <code>s</code> which is assumed to be in UTF-8 encoding; <code>send</code> points to 1 beyond the end of <code>s</code>. <code>*retlen</code> will be set to the length, in bytes, of that character.</p>

<p>If <code>s</code> does not point to a well-formed UTF-8 character and UTF8 warnings are enabled, zero is returned and <code>*retlen</code> is set (if <code>retlen</code> isn&#39;t <code>NULL</code>) to -1. If those warnings are off, the computed value, if well-defined (or the Unicode REPLACEMENT CHARACTER if not), is silently returned, and <code>*retlen</code> is set (if <code>retlen</code> isn&#39;t <code>NULL</code>) so that (<span style="white-space: nowrap;"><code>s</code> + <code>*retlen</code></span>) is the next possible position in <code>s</code> that could begin a non-malformed character. See <a href="perlapi.html#utf8n_to_uvchr">&quot;utf8n_to_uvchr&quot;</a> for details on when the REPLACEMENT CHARACTER is returned.</p>

<ul>

<pre><code class="plaintext">UV  utf8_to_uvchr_buf(const U8 *s, const U8 *send, STRLEN *retlen)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UVCHR_IS_INVARIANT"><a class="permalink" href="perlapi.html#UVCHR_IS_INVARIANT">#</a><code>UVCHR_IS_INVARIANT</code> </dt>
<dd>

<p>Evaluates to 1 if the representation of code point <code>cp</code> is the same whether or not it is encoded in UTF-8; otherwise evaluates to 0. UTF-8 invariant characters can be copied as-is when converting to/from UTF-8, saving time. <code>cp</code> is Unicode if above 255; otherwise is platform-native.</p>

<ul>

<pre><code class="plaintext">bool  UVCHR_IS_INVARIANT(UV cp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UVCHR_SKIP"><a class="permalink" href="perlapi.html#UVCHR_SKIP">#</a><code>UVCHR_SKIP</code> </dt>
<dd>

<p>returns the number of bytes required to represent the code point <code>cp</code> when encoded as UTF-8. <code>cp</code> is a native (ASCII or EBCDIC) code point if less than 255; a Unicode code point otherwise.</p>

<ul>

<pre><code class="plaintext">STRLEN  UVCHR_SKIP(UV cp)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="uvchr_to_utf8"><a class="permalink" href="perlapi.html#uvchr_to_utf8">#</a><code>uvchr_to_utf8</code> </dt>
<dd>

<p>Adds the UTF-8 representation of the native code point <code>uv</code> to the end of the string <code>d</code>; <code>d</code> should have at least <code>UVCHR_SKIP(uv)+1</code> (up to <code>UTF8_MAXBYTES+1</code>) free bytes available. The return value is the pointer to the byte after the end of the new character. In other words,</p>

<pre><code>d = uvchr_to_utf8(d, uv);</code></pre>

<p>is the recommended wide native character-aware way of saying</p>

<pre><code>*(d++) = uv;</code></pre>

<p>This function accepts any code point from 0..<code>IV_MAX</code> as input. <code>IV_MAX</code> is typically 0x7FFF_FFFF in a 32-bit word.</p>

<p>It is possible to forbid or warn on non-Unicode code points, or those that may be problematic by using <a href="perlapi.html#uvchr_to_utf8_flags">&quot;uvchr_to_utf8_flags&quot;</a>.</p>

<ul>

<pre><code class="plaintext">U8*  uvchr_to_utf8(U8 *d, UV uv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="uvchr_to_utf8_flags"><a class="permalink" href="perlapi.html#uvchr_to_utf8_flags">#</a><code>uvchr_to_utf8_flags</code> </dt>
<dd>

<p>Adds the UTF-8 representation of the native code point <code>uv</code> to the end of the string <code>d</code>; <code>d</code> should have at least <code>UVCHR_SKIP(uv)+1</code> (up to <code>UTF8_MAXBYTES+1</code>) free bytes available. The return value is the pointer to the byte after the end of the new character. In other words,</p>

<pre><code>d = uvchr_to_utf8_flags(d, uv, flags);</code></pre>

<p>or, in most cases,</p>

<pre><code>d = uvchr_to_utf8_flags(d, uv, 0);</code></pre>

<p>This is the Unicode-aware way of saying</p>

<pre><code>*(d++) = uv;</code></pre>

<p>If <code>flags</code> is 0, this function accepts any code point from 0..<code>IV_MAX</code> as input. <code>IV_MAX</code> is typically 0x7FFF_FFFF in a 32-bit word.</p>

<p>Specifying <code>flags</code> can further restrict what is allowed and not warned on, as follows:</p>

<p>If <code>uv</code> is a Unicode surrogate code point and <code>UNICODE_WARN_SURROGATE</code> is set, the function will raise a warning, provided UTF8 warnings are enabled. If instead <code>UNICODE_DISALLOW_SURROGATE</code> is set, the function will fail and return NULL. If both flags are set, the function will both warn and return NULL.</p>

<p>Similarly, the <code>UNICODE_WARN_NONCHAR</code> and <code>UNICODE_DISALLOW_NONCHAR</code> flags affect how the function handles a Unicode non-character.</p>

<p>And likewise, the <code>UNICODE_WARN_SUPER</code> and <code>UNICODE_DISALLOW_SUPER</code> flags affect the handling of code points that are above the Unicode maximum of 0x10FFFF. Languages other than Perl may not be able to accept files that contain these.</p>

<p>The flag <code>UNICODE_WARN_ILLEGAL_INTERCHANGE</code> selects all three of the above WARN flags; and <code>UNICODE_DISALLOW_ILLEGAL_INTERCHANGE</code> selects all three DISALLOW flags. <code>UNICODE_DISALLOW_ILLEGAL_INTERCHANGE</code> restricts the allowed inputs to the strict UTF-8 traditionally defined by Unicode. Similarly, <code>UNICODE_WARN_ILLEGAL_C9_INTERCHANGE</code> and <code>UNICODE_DISALLOW_ILLEGAL_C9_INTERCHANGE</code> are shortcuts to select the above-Unicode and surrogate flags, but not the non-character ones, as defined in <a href="https://www.unicode.org/versions/corrigendum9.html">Unicode Corrigendum #9</a>. See <a href="perlunicode.html#Noncharacter-code-points">&quot;Noncharacter code points&quot; in perlunicode</a>.</p>

<p>Extremely high code points were never specified in any standard, and require an extension to UTF-8 to express, which Perl does. It is likely that programs written in something other than Perl would not be able to read files that contain these; nor would Perl understand files written by something that uses a different extension. For these reasons, there is a separate set of flags that can warn and/or disallow these extremely high code points, even if other above-Unicode ones are accepted. They are the <code>UNICODE_WARN_PERL_EXTENDED</code> and <code>UNICODE_DISALLOW_PERL_EXTENDED</code> flags. For more information see <code><a href="perlapi.html#UTF8_GOT_PERL_EXTENDED">&quot;UTF8_GOT_PERL_EXTENDED&quot;</a></code>. Of course <code>UNICODE_DISALLOW_SUPER</code> will treat all above-Unicode code points, including these, as malformations. (Note that the Unicode standard considers anything above 0x10FFFF to be illegal, but there are standards predating it that allow up to 0x7FFF_FFFF (2**31 -1))</p>

<p>A somewhat misleadingly named synonym for <code>UNICODE_WARN_PERL_EXTENDED</code> is retained for backward compatibility: <code>UNICODE_WARN_ABOVE_31_BIT</code>. Similarly, <code>UNICODE_DISALLOW_ABOVE_31_BIT</code> is usable instead of the more accurately named <code>UNICODE_DISALLOW_PERL_EXTENDED</code>. The names are misleading because on EBCDIC platforms,these flags can apply to code points that actually do fit in 31 bits. The new names accurately describe the situation in all cases.</p>

<ul>

<pre><code class="plaintext">U8*  uvchr_to_utf8_flags(U8 *d, UV uv, UV flags)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="uvchr_to_utf8_flags_msgs"><a class="permalink" href="perlapi.html#uvchr_to_utf8_flags_msgs">#</a><code>uvchr_to_utf8_flags_msgs</code> </dt>
<dd>

<p>THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES.</p>

<p>Most code should use <code><a href="perlapi.html#uvchr_to_utf8_flags">&quot;uvchr_to_utf8_flags&quot;</a>()</code> rather than call this directly.</p>

<p>This function is for code that wants any warning and/or error messages to be returned to the caller rather than be displayed. All messages that would have been displayed if all lexical warnings are enabled will be returned.</p>

<p>It is just like <code><a href="perlapi.html#uvchr_to_utf8_flags">&quot;uvchr_to_utf8_flags&quot;</a></code> but it takes an extra parameter placed after all the others, <code>msgs</code>. If this parameter is 0, this function behaves identically to <code><a href="perlapi.html#uvchr_to_utf8_flags">&quot;uvchr_to_utf8_flags&quot;</a></code>. Otherwise, <code>msgs</code> should be a pointer to an <code>HV *</code> variable, in which this function creates a new HV to contain any appropriate messages. The hash has three key-value pairs, as follows:</p>

<dl>

<dt id="text1"><a class="permalink" href="perlapi.html#text1">#</a><code>text</code></dt>
<dd>

<p>The text of the message as a <code>SVpv</code>.</p>

</dd>
<dt id="warn_categories1"><a class="permalink" href="perlapi.html#warn_categories1">#</a><code>warn_categories</code></dt>
<dd>

<p>The warning category (or categories) packed into a <code>SVuv</code>.</p>

</dd>
<dt id="flag1"><a class="permalink" href="perlapi.html#flag1">#</a><code>flag</code></dt>
<dd>

<p>A single flag bit associated with this message, in a <code>SVuv</code>. The bit corresponds to some bit in the <code>*errors</code> return value, such as <code>UNICODE_GOT_SURROGATE</code>.</p>

</dd>
</dl>

<p>It&#39;s important to note that specifying this parameter as non-null will cause any warnings this function would otherwise generate to be suppressed, and instead be placed in <code>*msgs</code>. The caller can check the lexical warnings state (or not) when choosing what to do with the returned messages.</p>

<p>The caller, of course, is responsible for freeing any returned HV.</p>

<ul>

<pre><code class="plaintext">U8*  uvchr_to_utf8_flags_msgs(U8 *d, UV uv, UV flags, HV ** msgs)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Utility-Functions"><a class="permalink" href="perlapi.html#Utility-Functions">#</a><a id="Utility"></a>Utility Functions</h1>

<dl>

<dt id="C_ARRAY_END"><a class="permalink" href="perlapi.html#C_ARRAY_END">#</a><code>C_ARRAY_END</code> </dt>
<dd>

<p>Returns a pointer to one element past the final element of the input C array.</p>

<ul>

<pre><code class="plaintext">void *  C_ARRAY_END(void *a)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="C_ARRAY_LENGTH"><a class="permalink" href="perlapi.html#C_ARRAY_LENGTH">#</a><code>C_ARRAY_LENGTH</code> </dt>
<dd>

<p>Returns the number of elements in the input C array (so you want your zero-based indices to be less than but not equal to).</p>

<ul>

<pre><code class="plaintext">STRLEN  C_ARRAY_LENGTH(void *a)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="getcwd_sv"><a class="permalink" href="perlapi.html#getcwd_sv">#</a><code>getcwd_sv</code> </dt>
<dd>

<p>Fill <code>sv</code> with current working directory</p>

<ul>

<pre><code class="plaintext">int  getcwd_sv(SV* sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IN_PERL_COMPILETIME"><a class="permalink" href="perlapi.html#IN_PERL_COMPILETIME">#</a><code>IN_PERL_COMPILETIME</code> </dt>
<dd>

<p>Returns 1 if this macro is being called during the compilation phase of the program; otherwise 0;</p>

<ul>

<pre><code class="plaintext">bool  IN_PERL_COMPILETIME</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IN_PERL_RUNTIME"><a class="permalink" href="perlapi.html#IN_PERL_RUNTIME">#</a><code>IN_PERL_RUNTIME</code> </dt>
<dd>

<p>Returns 1 if this macro is being called during the execution phase of the program; otherwise 0;</p>

<ul>

<pre><code class="plaintext">bool  IN_PERL_RUNTIME</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="IS_SAFE_SYSCALL"><a class="permalink" href="perlapi.html#IS_SAFE_SYSCALL">#</a><code>IS_SAFE_SYSCALL</code> </dt>
<dd>

<p>Same as <a href="perlapi.html#is_safe_syscall">&quot;is_safe_syscall&quot;</a>.</p>

<ul>

<pre><code class="plaintext">bool  IS_SAFE_SYSCALL(NN const char *pv, STRLEN len,
                      NN const char *what, NN const char *op_name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="is_safe_syscall"><a class="permalink" href="perlapi.html#is_safe_syscall">#</a><code>is_safe_syscall</code> </dt>
<dd>

<p>Test that the given <code>pv</code> (with length <code>len</code>) doesn&#39;t contain any internal <code>NUL</code> characters. If it does, set <code>errno</code> to <code>ENOENT</code>, optionally warn using the <code>syscalls</code> category, and return FALSE.</p>

<p>Return TRUE if the name is safe.</p>

<p><code>what</code> and <code>op_name</code> are used in any warning.</p>

<p>Used by the <code>IS_SAFE_SYSCALL()</code> macro.</p>

<ul>

<pre><code class="plaintext">bool  is_safe_syscall(const char *pv, STRLEN len,
                      const char *what, const char *op_name)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="my_setenv"><a class="permalink" href="perlapi.html#my_setenv">#</a><code>my_setenv</code> </dt>
<dd>

<p>A wrapper for the C library <a href="http://man.he.net/man3/setenv">setenv(3)</a>. Don&#39;t use the latter, as the perl version has desirable safeguards</p>

<ul>

<pre><code class="plaintext">void  my_setenv(const char* nam, const char* val)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="Poison"><a class="permalink" href="perlapi.html#Poison">#</a><code>Poison</code> </dt>
<dd>

<p>PoisonWith(0xEF) for catching access to freed memory.</p>

<ul>

<pre><code class="plaintext">void  Poison(void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PoisonFree"><a class="permalink" href="perlapi.html#PoisonFree">#</a><code>PoisonFree</code> </dt>
<dd>

<p>PoisonWith(0xEF) for catching access to freed memory.</p>

<ul>

<pre><code class="plaintext">void  PoisonFree(void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PoisonNew"><a class="permalink" href="perlapi.html#PoisonNew">#</a><code>PoisonNew</code> </dt>
<dd>

<p>PoisonWith(0xAB) for catching access to allocated but uninitialized memory.</p>

<ul>

<pre><code class="plaintext">void  PoisonNew(void* dest, int nitems, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PoisonWith"><a class="permalink" href="perlapi.html#PoisonWith">#</a><code>PoisonWith</code> </dt>
<dd>

<p>Fill up memory with a byte pattern (a byte repeated over and over again) that hopefully catches attempts to access uninitialized memory.</p>

<ul>

<pre><code class="plaintext">void  PoisonWith(void* dest, int nitems, type, U8 byte)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="StructCopy"><a class="permalink" href="perlapi.html#StructCopy">#</a><code>StructCopy</code> </dt>
<dd>

<p>This is an architecture-independent macro to copy one structure to another.</p>

<ul>

<pre><code class="plaintext">void  StructCopy(type *src, type *dest, type)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_destroyable"><a class="permalink" href="perlapi.html#sv_destroyable">#</a><code>sv_destroyable</code> </dt>
<dd>

<p>Dummy routine which reports that object can be destroyed when there is no sharing module present. It ignores its single SV argument, and returns &#39;true&#39;. Exists to avoid test for a <code>NULL</code> function pointer and because it could potentially warn under some level of strict-ness.</p>

<ul>

<pre><code class="plaintext">bool  sv_destroyable(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="sv_nosharing"><a class="permalink" href="perlapi.html#sv_nosharing">#</a><code>sv_nosharing</code> </dt>
<dd>

<p>Dummy routine which &quot;shares&quot; an SV when there is no sharing module present. Or &quot;locks&quot; it. Or &quot;unlocks&quot; it. In other words, ignores its single SV argument. Exists to avoid test for a <code>NULL</code> function pointer and because it could potentially warn under some level of strict-ness.</p>

<ul>

<pre><code class="plaintext">void  sv_nosharing(SV *sv)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Versioning"><a class="permalink" href="perlapi.html#Versioning">#</a>Versioning</h1>

<dl>

<dt id="new_version"><a class="permalink" href="perlapi.html#new_version">#</a><code>new_version</code> </dt>
<dd>

<p>Returns a new version object based on the passed in SV:</p>

<pre><code>SV *sv = new_version(SV *ver);</code></pre>

<p>Does not alter the passed in ver SV. See &quot;upg_version&quot; if you want to upgrade the SV.</p>

<ul>

<pre><code class="plaintext">SV*  new_version(SV *ver)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PERL_REVISION"><a class="permalink" href="perlapi.html#PERL_REVISION">#</a><code>PERL_REVISION</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>PERL_REVISION</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>The major number component of the perl interpreter currently being compiled or executing. This has been <code>5</code> from 1993 into 2020.</p>

<p>Instead use one of the version comparison macros. See <code><a href="perlapi.html#PERL_VERSION_EQ">&quot;PERL_VERSION_EQ&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="PERL_SUBVERSION"><a class="permalink" href="perlapi.html#PERL_SUBVERSION">#</a><code>PERL_SUBVERSION</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>PERL_SUBVERSION</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>The micro number component of the perl interpreter currently being compiled or executing. In stable releases this gives the dot release number for maintenance updates. In development releases this gives a tag for a snapshot of the status at various points in the development cycle.</p>

<p>Instead use one of the version comparison macros. See <code><a href="perlapi.html#PERL_VERSION_EQ">&quot;PERL_VERSION_EQ&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VERSION"><a class="permalink" href="perlapi.html#PERL_VERSION">#</a><code>PERL_VERSION</code> </dt>
<dd>

<p><code><b>DEPRECATED!</b></code> It is planned to remove <code>PERL_VERSION</code> from a future release of Perl. Do not use it for new code; remove it from existing code.</p>

<p>The minor number component of the perl interpreter currently being compiled or executing. Between 1993 into 2020, this has ranged from 0 to 33.</p>

<p>Instead use one of the version comparison macros. See <code><a href="perlapi.html#PERL_VERSION_EQ">&quot;PERL_VERSION_EQ&quot;</a></code>.</p>

</dd>
</dl>

<dl>

<dt id="PERL_VERSION_EQ"><a class="permalink" href="perlapi.html#PERL_VERSION_EQ">#</a><code>PERL_VERSION_EQ</code></dt>
<dd>

</dd>
<dt id="PERL_VERSION_NE"><a class="permalink" href="perlapi.html#PERL_VERSION_NE">#</a><code>PERL_VERSION_NE</code></dt>
<dd>

</dd>
<dt id="PERL_VERSION_LT"><a class="permalink" href="perlapi.html#PERL_VERSION_LT">#</a><code>PERL_VERSION_LT</code></dt>
<dd>

</dd>
<dt id="PERL_VERSION_LE"><a class="permalink" href="perlapi.html#PERL_VERSION_LE">#</a><code>PERL_VERSION_LE</code></dt>
<dd>

</dd>
<dt id="PERL_VERSION_GT"><a class="permalink" href="perlapi.html#PERL_VERSION_GT">#</a><code>PERL_VERSION_GT</code></dt>
<dd>

</dd>
<dt id="PERL_VERSION_GE"><a class="permalink" href="perlapi.html#PERL_VERSION_GE">#</a><code>PERL_VERSION_GE</code> </dt>
<dd>

<p>Returns whether or not the perl currently being compiled has the specified relationship to the perl given by the parameters. For example,</p>

<pre><code class="plaintext">#if PERL_VERSION_GT(5,24,2)
  code that will only be compiled on perls after v5.24.2
#else
  fallback code
#endif</code></pre>

<p>Note that this is usable in making compile-time decisions</p>

<p>You may use the special value &#39;*&#39; for the final number to mean ALL possible values for it. Thus,</p>

<pre><code class="plaintext">#if PERL_VERSION_EQ(5,31,&#39;*&#39;)</code></pre>

<p>means all perls in the 5.31 series. And</p>

<pre><code class="plaintext">#if PERL_VERSION_NE(5,24,&#39;*&#39;)</code></pre>

<p>means all perls EXCEPT 5.24 ones. And</p>

<pre><code class="plaintext">#if PERL_VERSION_LE(5,9,&#39;*&#39;)</code></pre>

<p>is effectively</p>

<pre><code class="plaintext">#if PERL_VERSION_LT(5,10,0)</code></pre>

<p>This means you don&#39;t have to think so much when converting from the existing deprecated <code>PERL_VERSION</code> to using this macro:</p>

<pre><code class="plaintext">#if PERL_VERSION &lt;= 9</code></pre>

<p>becomes</p>

<pre><code class="plaintext">#if PERL_VERSION_LE(5,9,&#39;*&#39;)</code></pre>

<ul>

<pre><code class="plaintext">bool  PERL_VERSION_EQ(const U8 major, const U8 minor,
                      const U8 patch)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="prescan_version"><a class="permalink" href="perlapi.html#prescan_version">#</a><code>prescan_version</code> </dt>
<dd>

<p>Validate that a given string can be parsed as a version object, but doesn&#39;t actually perform the parsing. Can use either strict or lax validation rules. Can optionally set a number of hint variables to save the parsing code some time when tokenizing.</p>

<ul>

<pre><code class="plaintext">const char*  prescan_version(const char *s, bool strict,
                             const char** errstr, bool *sqv,
                             int *ssaw_decimal, int *swidth,
                             bool *salpha)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="scan_version"><a class="permalink" href="perlapi.html#scan_version">#</a><code>scan_version</code> </dt>
<dd>

<p>Returns a pointer to the next character after the parsed version string, as well as upgrading the passed in SV to an RV.</p>

<p>Function must be called with an already existing SV like</p>

<pre><code>sv = newSV(0);
s = scan_version(s, SV *sv, bool qv);</code></pre>

<p>Performs some preprocessing to the string to ensure that it has the correct characteristics of a version. Flags the object if it contains an underscore (which denotes this is an alpha version). The boolean qv denotes that the version should be interpreted as if it had multiple decimals, even if it doesn&#39;t.</p>

<ul>

<pre><code class="plaintext">const char*  scan_version(const char *s, SV *rv, bool qv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="upg_version"><a class="permalink" href="perlapi.html#upg_version">#</a><code>upg_version</code> </dt>
<dd>

<p>In-place upgrade of the supplied SV to a version object.</p>

<pre><code>SV *sv = upg_version(SV *sv, bool qv);</code></pre>

<p>Returns a pointer to the upgraded SV. Set the boolean qv if you want to force this SV to be interpreted as an &quot;extended&quot; version.</p>

<ul>

<pre><code class="plaintext">SV*  upg_version(SV *ver, bool qv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vcmp"><a class="permalink" href="perlapi.html#vcmp">#</a><code>vcmp</code> </dt>
<dd>

<p>Version object aware cmp. Both operands must already have been converted into version objects.</p>

<ul>

<pre><code class="plaintext">int  vcmp(SV *lhv, SV *rhv)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vnormal"><a class="permalink" href="perlapi.html#vnormal">#</a><code>vnormal</code> </dt>
<dd>

<p>Accepts a version object and returns the normalized string representation. Call like:</p>

<pre><code>sv = vnormal(rv);</code></pre>

<p>NOTE: you can pass either the object directly or the SV contained within the RV.</p>

<p>The SV returned has a refcount of 1.</p>

<ul>

<pre><code class="plaintext">SV*  vnormal(SV *vs)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vnumify"><a class="permalink" href="perlapi.html#vnumify">#</a><code>vnumify</code> </dt>
<dd>

<p>Accepts a version object and returns the normalized floating point representation. Call like:</p>

<pre><code>sv = vnumify(rv);</code></pre>

<p>NOTE: you can pass either the object directly or the SV contained within the RV.</p>

<p>The SV returned has a refcount of 1.</p>

<ul>

<pre><code class="plaintext">SV*  vnumify(SV *vs)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vstringify"><a class="permalink" href="perlapi.html#vstringify">#</a><code>vstringify</code> </dt>
<dd>

<p>In order to maintain maximum compatibility with earlier versions of Perl, this function will return either the floating point notation or the multiple dotted notation, depending on whether the original version contained 1 or more dots, respectively.</p>

<p>The SV returned has a refcount of 1.</p>

<ul>

<pre><code class="plaintext">SV*  vstringify(SV *vs)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vverify"><a class="permalink" href="perlapi.html#vverify">#</a><code>vverify</code> </dt>
<dd>

<p>Validates that the SV contains valid internal structure for a version object. It may be passed either the version object (RV) or the hash itself (HV). If the structure is valid, it returns the HV. If the structure is invalid, it returns NULL.</p>

<pre><code>SV *hv = vverify(sv);</code></pre>

<p>Note that it only confirms the bare minimum structure (so as not to get confused by derived classes which may contain additional hash entries):</p>

<ul>

<li><p>The SV is an HV or a reference to an HV</p>

</li>
<li><p>The hash contains a &quot;version&quot; key</p>

</li>
<li><p>The &quot;version&quot; key has a reference to an AV as its value</p>

</li>
</ul>

<ul>

<pre><code class="plaintext">SV*  vverify(SV *vs)</code></pre>

</ul>

</dd>
</dl>

<h1 id="Warning-and-Dieing"><a class="permalink" href="perlapi.html#Warning-and-Dieing">#</a><a id="Warning"></a>Warning and Dieing</h1>

<p>In all these calls, the <code>U32 w<i>n</i></code> parameters are warning category constants. You can see the ones currently available in <a href="warnings.html#Category-Hierarchy">&quot;Category Hierarchy&quot; in warnings</a>, just capitalize all letters in the names and prefix them by <code>WARN_</code>. So, for example, the category <code>void</code> used in a perl program becomes <code>WARN_VOID</code> when used in XS code and passed to one of the calls below.</p>

<dl>

<dt id="ckWARN"><a class="permalink" href="perlapi.html#ckWARN">#</a><code>ckWARN</code></dt>
<dd>

</dd>
<dt id="ckWARN2"><a class="permalink" href="perlapi.html#ckWARN2">#</a><code>ckWARN2</code></dt>
<dd>

</dd>
<dt id="ckWARN3"><a class="permalink" href="perlapi.html#ckWARN3">#</a><code>ckWARN3</code></dt>
<dd>

</dd>
<dt id="ckWARN4"><a class="permalink" href="perlapi.html#ckWARN4">#</a><code>ckWARN4</code> </dt>
<dd>

<p>These return a boolean as to whether or not warnings are enabled for any of the warning category(ies) parameters: <code>w</code>, <code>w1</code>, ....</p>

<p>Should any of the categories by default be enabled even if not within the scope of <span style="white-space: nowrap;"><code>use warnings</code></span>, instead use the <code><a href="perlapi.html#ckWARN_d">&quot;ckWARN_d&quot;</a></code> macros.</p>

<p>The categories must be completely independent, one may not be subclassed from the other.</p>

<ul>

<pre><code class="plaintext">bool  ckWARN (U32 w)
bool  ckWARN2(U32 w1, U32 w2)
bool  ckWARN3(U32 w1, U32 w2, U32 w3)
bool  ckWARN4(U32 w1, U32 w2, U32 w3, U32 w4)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ckWARN_d"><a class="permalink" href="perlapi.html#ckWARN_d">#</a><code>ckWARN_d</code></dt>
<dd>

</dd>
<dt id="ckWARN2_d"><a class="permalink" href="perlapi.html#ckWARN2_d">#</a><code>ckWARN2_d</code></dt>
<dd>

</dd>
<dt id="ckWARN3_d"><a class="permalink" href="perlapi.html#ckWARN3_d">#</a><code>ckWARN3_d</code></dt>
<dd>

</dd>
<dt id="ckWARN4_d"><a class="permalink" href="perlapi.html#ckWARN4_d">#</a><code>ckWARN4_d</code> </dt>
<dd>

<p>Like <code><a href="perlapi.html#ckWARN">&quot;ckWARN&quot;</a></code>, but for use if and only if the warning category(ies) is by default enabled even if not within the scope of <span style="white-space: nowrap;"><code>use warnings</code></span>.</p>

<ul>

<pre><code class="plaintext">bool  ckWARN_d (U32 w)
bool  ckWARN2_d(U32 w1, U32 w2)
bool  ckWARN3_d(U32 w1, U32 w2, U32 w3)
bool  ckWARN4_d(U32 w1, U32 w2, U32 w3, U32 w4)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ck_warner"><a class="permalink" href="perlapi.html#ck_warner">#</a><code>ck_warner</code></dt>
<dd>

</dd>
<dt id="ck_warner_d"><a class="permalink" href="perlapi.html#ck_warner_d">#</a><code>ck_warner_d</code> </dt>
<dd>

<p>If none of the warning categories given by <code>err</code> are enabled, do nothing; otherwise call <code><a href="perlapi.html#warner">&quot;warner&quot;</a></code> or <code><a href="perlapi.html#warner_nocontext">&quot;warner_nocontext&quot;</a></code> with the passed-in parameters;.</p>

<p><code>err</code> must be one of the <code><a href="perlapi.html#packWARN">&quot;packWARN&quot;</a></code>, <code>packWARN2</code>, <code>packWARN3</code>, <code>packWARN4</code> macros populated with the appropriate number of warning categories.</p>

<p>The two forms differ only in that <code>ck_warner_d</code> should be used if warnings for any of the categories are by default enabled.</p>

<p>NOTE: <code>ck_warner</code> must be explicitly called as <code>Perl_ck_warner</code> with an <code>aTHX_</code> parameter.</p>

<p>NOTE: <code>ck_warner_d</code> must be explicitly called as <code>Perl_ck_warner_d</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_ck_warner(pTHX_ U32 err, const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CLEAR_ERRSV"><a class="permalink" href="perlapi.html#CLEAR_ERRSV">#</a><code>CLEAR_ERRSV</code> </dt>
<dd>

<p>Clear the contents of <code>$@</code>, setting it to the empty string.</p>

<p>This replaces any read-only SV with a fresh SV and removes any magic.</p>

<ul>

<pre><code class="plaintext">void  CLEAR_ERRSV()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="croak"><a class="permalink" href="perlapi.html#croak">#</a><code>croak</code></dt>
<dd>

</dd>
<dt id="croak_nocontext"><a class="permalink" href="perlapi.html#croak_nocontext">#</a><code>croak_nocontext</code> </dt>
<dd>

<p>These are XS interfaces to Perl&#39;s <code>die</code> function.</p>

<p>They take a sprintf-style format pattern and argument list, which are used to generate a string message. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <code><a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a></code>.</p>

<p>The error message will be used as an exception, by default returning control to the nearest enclosing <code>eval</code>, but subject to modification by a <code>$SIG{__DIE__}</code> handler. In any case, these croak functions never return normally.</p>

<p>For historical reasons, if <code>pat</code> is null then the contents of <code>ERRSV</code> (<code>$@</code>) will be used as an error message or object instead of building an error message from arguments. If you want to throw a non-string object, or build an error message in an SV yourself, it is preferable to use the <code><a href="perlapi.html#croak_sv">&quot;croak_sv&quot;</a></code> function, which does not involve clobbering <code>ERRSV</code>.</p>

<p>The two forms differ only in that <code>croak_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter. It is usually preferred as it takes up fewer bytes of code than plain <code>Perl_croak</code>, and time is rarely a critical resource when you are about to throw an exception.</p>

<p>NOTE: <code>croak</code> must be explicitly called as <code>Perl_croak</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_croak     (pTHX_ const char* pat, ...)
void  croak_nocontext(const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="croak_no_modify"><a class="permalink" href="perlapi.html#croak_no_modify">#</a><code>croak_no_modify</code> </dt>
<dd>

<p>This encapsulates a common reason for dying, generating terser object code than using the generic <code>Perl_croak</code>. It is exactly equivalent to <code>Perl_croak(aTHX_ &quot;%s&quot;, PL_no_modify)</code> (which expands to something like &quot;Modification of a read-only value attempted&quot;).</p>

<p>Less code used on exception code paths reduces CPU cache pressure.</p>

<ul>

<pre><code class="plaintext">void  croak_no_modify()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="croak_sv"><a class="permalink" href="perlapi.html#croak_sv">#</a><code>croak_sv</code> </dt>
<dd>

<p>This is an XS interface to Perl&#39;s <code>die</code> function.</p>

<p><code>baseex</code> is the error message or object. If it is a reference, it will be used as-is. Otherwise it is used as a string, and if it does not end with a newline then it will be extended with some indication of the current location in the code, as described for <a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a>.</p>

<p>The error message or object will be used as an exception, by default returning control to the nearest enclosing <code>eval</code>, but subject to modification by a <code>$SIG{__DIE__}</code> handler. In any case, the <code>croak_sv</code> function never returns normally.</p>

<p>To die with a simple string message, the <a href="perlapi.html#croak">&quot;croak&quot;</a> function may be more convenient.</p>

<ul>

<pre><code class="plaintext">void  croak_sv(SV *baseex)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="die"><a class="permalink" href="perlapi.html#die">#</a><code>die</code> </dt>
<dd>

<p>Behaves the same as <a href="perlapi.html#croak">&quot;croak&quot;</a>, except for the return type. It should be used only where the <code>OP *</code> return type is required. The function never actually returns.</p>

<p>NOTE: <code>die</code> must be explicitly called as <code>Perl_die</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">OP*  Perl_die(pTHX_ const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="die_sv"><a class="permalink" href="perlapi.html#die_sv">#</a><code>die_sv</code></dt>
<dd>

</dd>
<dt id="die_nocontext"><a class="permalink" href="perlapi.html#die_nocontext">#</a><code>die_nocontext</code> </dt>
<dd>

<p>These ehave the same as <a href="perlapi.html#croak_sv">&quot;croak_sv&quot;</a>, except for the return type. It should be used only where the <code>OP *</code> return type is required. The functions never actually return.</p>

<p>The two forms differ only in that <code>die_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<ul>

<pre><code class="plaintext">OP*  die_sv       (SV *baseex)
OP*  die_nocontext(const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ERRSV"><a class="permalink" href="perlapi.html#ERRSV">#</a><code>ERRSV</code> </dt>
<dd>

<p>Returns the SV for <code>$@</code>, creating it if needed.</p>

<ul>

<pre><code class="plaintext">SV *  ERRSV</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="packWARN"><a class="permalink" href="perlapi.html#packWARN">#</a><code>packWARN</code></dt>
<dd>

</dd>
<dt id="packWARN2"><a class="permalink" href="perlapi.html#packWARN2">#</a><code>packWARN2</code></dt>
<dd>

</dd>
<dt id="packWARN3"><a class="permalink" href="perlapi.html#packWARN3">#</a><code>packWARN3</code></dt>
<dd>

</dd>
<dt id="packWARN4"><a class="permalink" href="perlapi.html#packWARN4">#</a><code>packWARN4</code> </dt>
<dd>

<p>These macros are used to pack warning categories into a single U32 to pass to macros and functions that take a warning category parameter. The number of categories to pack is given by the name, with a corresponding number of category parameters passed.</p>

<ul>

<pre><code class="plaintext">U32  packWARN (U32 w1)
U32  packWARN2(U32 w1, U32 w2)
U32  packWARN3(U32 w1, U32 w2, U32 w3)
U32  packWARN4(U32 w1, U32 w2, U32 w3, U32 w4)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_curcop"><a class="permalink" href="perlapi.html#PL_curcop">#</a><code>PL_curcop</code> </dt>
<dd>

<p>The currently active COP (control op) roughly representing the current statement in the source.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">COP*  PL_curcop</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_curstash"><a class="permalink" href="perlapi.html#PL_curstash">#</a><code>PL_curstash</code> </dt>
<dd>

<p>The stash for the package code will be compiled into.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">HV*  PL_curstash</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="PL_defgv"><a class="permalink" href="perlapi.html#PL_defgv">#</a><code>PL_defgv</code> </dt>
<dd>

<p>The GV representing <code>*_</code>. Useful for access to <code>$_</code>.</p>

<p>On threaded perls, each thread has an independent copy of this variable; each initialized at creation time with the current value of the creating thread&#39;s copy.</p>

<ul>

<pre><code class="plaintext">GV *  PL_defgv</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="SANE_ERRSV"><a class="permalink" href="perlapi.html#SANE_ERRSV">#</a><code>SANE_ERRSV</code> </dt>
<dd>

<p>Clean up ERRSV so we can safely set it.</p>

<p>This replaces any read-only SV with a fresh writable copy and removes any magic.</p>

<ul>

<pre><code class="plaintext">void  SANE_ERRSV()</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vcroak"><a class="permalink" href="perlapi.html#vcroak">#</a><code>vcroak</code> </dt>
<dd>

<p>This is an XS interface to Perl&#39;s <code>die</code> function.</p>

<p><code>pat</code> and <code>args</code> are a sprintf-style format pattern and encapsulated argument list. These are used to generate a string message. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a>.</p>

<p>The error message will be used as an exception, by default returning control to the nearest enclosing <code>eval</code>, but subject to modification by a <code>$SIG{__DIE__}</code> handler. In any case, the <code>croak</code> function never returns normally.</p>

<p>For historical reasons, if <code>pat</code> is null then the contents of <code>ERRSV</code> (<code>$@</code>) will be used as an error message or object instead of building an error message from arguments. If you want to throw a non-string object, or build an error message in an SV yourself, it is preferable to use the <a href="perlapi.html#croak_sv">&quot;croak_sv&quot;</a> function, which does not involve clobbering <code>ERRSV</code>.</p>

<ul>

<pre><code class="plaintext">void  vcroak(const char* pat, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vwarn"><a class="permalink" href="perlapi.html#vwarn">#</a><code>vwarn</code> </dt>
<dd>

<p>This is an XS interface to Perl&#39;s <code>warn</code> function.</p>

<p>This is like <code><a href="perlapi.html#warn">&quot;warn&quot;</a></code>, but <code>args</code> are an encapsulated argument list.</p>

<p>Unlike with <a href="perlapi.html#vcroak">&quot;vcroak&quot;</a>, <code>pat</code> is not permitted to be null.</p>

<ul>

<pre><code class="plaintext">void  vwarn(const char* pat, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="vwarner"><a class="permalink" href="perlapi.html#vwarner">#</a><code>vwarner</code> </dt>
<dd>

<p>This is like <code><a href="perlapi.html#warner">&quot;warner&quot;</a></code>, but <code>args</code> are an encapsulated argument list.</p>

<ul>

<pre><code class="plaintext">void  vwarner(U32 err, const char* pat, va_list* args)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="warn"><a class="permalink" href="perlapi.html#warn">#</a><code>warn</code></dt>
<dd>

</dd>
<dt id="warn_nocontext"><a class="permalink" href="perlapi.html#warn_nocontext">#</a><code>warn_nocontext</code> </dt>
<dd>

<p>These are XS interfaces to Perl&#39;s <code>warn</code> function.</p>

<p>They take a sprintf-style format pattern and argument list, which are used to generate a string message. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <code><a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a></code>.</p>

<p>The error message or object will by default be written to standard error, but this is subject to modification by a <code>$SIG{__WARN__}</code> handler.</p>

<p>Unlike with <code><a href="perlapi.html#croak">&quot;croak&quot;</a></code>, <code>pat</code> is not permitted to be null.</p>

<p>The two forms differ only in that <code>warn_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>NOTE: <code>warn</code> must be explicitly called as <code>Perl_warn</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_warn     (pTHX_ const char* pat, ...)
void  warn_nocontext(const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="warner"><a class="permalink" href="perlapi.html#warner">#</a><code>warner</code></dt>
<dd>

</dd>
<dt id="warner_nocontext"><a class="permalink" href="perlapi.html#warner_nocontext">#</a><code>warner_nocontext</code> </dt>
<dd>

<p>These output a warning of the specified category (or categories) given by <code>err</code>, using the sprintf-style format pattern <code>pat</code>, and argument list.</p>

<p><code>err</code> must be one of the <code><a href="perlapi.html#packWARN">&quot;packWARN&quot;</a></code>, <code>packWARN2</code>, <code>packWARN3</code>, <code>packWARN4</code> macros populated with the appropriate number of warning categories. If any of the warning categories they specify is fatal, a fatal exception is thrown.</p>

<p>In any event a message is generated by the pattern and arguments. If the message does not end with a newline, then it will be extended with some indication of the current location in the code, as described for <a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a>.</p>

<p>The error message or object will by default be written to standard error, but this is subject to modification by a <code>$SIG{__WARN__}</code> handler.</p>

<p><code>pat</code> is not permitted to be null.</p>

<p>The two forms differ only in that <code>warner_nocontext</code> does not take a thread context (<code>aTHX</code>) parameter, so is used in situations where the caller doesn&#39;t already have the thread context.</p>

<p>These functions differ from the similarly named <code><a href="perlapi.html#warn">&quot;warn&quot;</a></code> functions, in that the latter are for XS code to unconditionally display a warning, whereas these are for code that may be compiling a perl program, and does extra checking to see if the warning should be fatal.</p>

<p>NOTE: <code>warner</code> must be explicitly called as <code>Perl_warner</code> with an <code>aTHX_</code> parameter.</p>

<ul>

<pre><code class="plaintext">void  Perl_warner     (pTHX_ U32 err, const char* pat, ...)
void  warner_nocontext(U32 err, const char* pat, ...)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="warn_sv"><a class="permalink" href="perlapi.html#warn_sv">#</a><code>warn_sv</code> </dt>
<dd>

<p>This is an XS interface to Perl&#39;s <code>warn</code> function.</p>

<p><code>baseex</code> is the error message or object. If it is a reference, it will be used as-is. Otherwise it is used as a string, and if it does not end with a newline then it will be extended with some indication of the current location in the code, as described for <a href="perlapi.html#mess_sv">&quot;mess_sv&quot;</a>.</p>

<p>The error message or object will by default be written to standard error, but this is subject to modification by a <code>$SIG{__WARN__}</code> handler.</p>

<p>To warn with a simple string message, the <a href="perlapi.html#warn">&quot;warn&quot;</a> function may be more convenient.</p>

<ul>

<pre><code class="plaintext">void  warn_sv(SV *baseex)</code></pre>

</ul>

</dd>
</dl>

<h1 id="XS"><a class="permalink" href="perlapi.html#XS">#</a>XS</h1>

<p><i>xsubpp</i> compiles XS code into C. See <a href="perlutil.html#xsubpp">&quot;xsubpp&quot; in perlutil</a>.</p>

<dl>

<dt id="ax"><a class="permalink" href="perlapi.html#ax">#</a><code>ax</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to indicate the stack base offset, used by the <code>ST</code>, <code>XSprePUSH</code> and <code>XSRETURN</code> macros. The <code>dMARK</code> macro must be called prior to setup the <code>MARK</code> variable.</p>

<ul>

<pre><code class="plaintext">I32  ax</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="CLASS"><a class="permalink" href="perlapi.html#CLASS">#</a><code>CLASS</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to indicate the class name for a C++ XS constructor. This is always a <code>char*</code>. See <code><a href="perlapi.html#THIS">&quot;THIS&quot;</a></code>.</p>

<ul>

<pre><code class="plaintext">char*  CLASS</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dAX"><a class="permalink" href="perlapi.html#dAX">#</a><code>dAX</code> </dt>
<dd>

<p>Sets up the <code>ax</code> variable. This is usually handled automatically by <code>xsubpp</code> by calling <code>dXSARGS</code>.</p>

<ul>

<pre><code>dAX;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dAXMARK"><a class="permalink" href="perlapi.html#dAXMARK">#</a><code>dAXMARK</code> </dt>
<dd>

<p>Sets up the <code>ax</code> variable and stack marker variable <code>mark</code>. This is usually handled automatically by <code>xsubpp</code> by calling <code>dXSARGS</code>.</p>

<ul>

<pre><code>dAXMARK;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dITEMS"><a class="permalink" href="perlapi.html#dITEMS">#</a><code>dITEMS</code> </dt>
<dd>

<p>Sets up the <code>items</code> variable. This is usually handled automatically by <code>xsubpp</code> by calling <code>dXSARGS</code>.</p>

<ul>

<pre><code>dITEMS;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dMY_CXT_SV"><a class="permalink" href="perlapi.html#dMY_CXT_SV">#</a><code>dMY_CXT_SV</code> </dt>
<dd>

<p>Now a placeholder that declares nothing</p>

<ul>

<pre><code>dMY_CXT_SV;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dUNDERBAR"><a class="permalink" href="perlapi.html#dUNDERBAR">#</a><code>dUNDERBAR</code> </dt>
<dd>

<p>Sets up any variable needed by the <code>UNDERBAR</code> macro. It used to define <code>padoff_du</code>, but it is currently a noop. However, it is strongly advised to still use it for ensuring past and future compatibility.</p>

<ul>

<pre><code>dUNDERBAR;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dXSARGS"><a class="permalink" href="perlapi.html#dXSARGS">#</a><code>dXSARGS</code> </dt>
<dd>

<p>Sets up stack and mark pointers for an XSUB, calling <code>dSP</code> and <code>dMARK</code>. Sets up the <code>ax</code> and <code>items</code> variables by calling <code>dAX</code> and <code>dITEMS</code>. This is usually handled automatically by <code>xsubpp</code>.</p>

<ul>

<pre><code>dXSARGS;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="dXSI32"><a class="permalink" href="perlapi.html#dXSI32">#</a><code>dXSI32</code> </dt>
<dd>

<p>Sets up the <code>ix</code> variable for an XSUB which has aliases. This is usually handled automatically by <code>xsubpp</code>.</p>

<ul>

<pre><code>dXSI32;</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="items"><a class="permalink" href="perlapi.html#items">#</a><code>items</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to indicate the number of items on the stack. See <a href="perlxs.html#Variable-length-Parameter-Lists">&quot;Variable-length Parameter Lists&quot; in perlxs</a>.</p>

<ul>

<pre><code class="plaintext">I32  items</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ix"><a class="permalink" href="perlapi.html#ix">#</a><code>ix</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to indicate which of an XSUB&#39;s aliases was used to invoke it. See <a href="perlxs.html#The-ALIAS%3A-Keyword">&quot;The ALIAS: Keyword&quot; in perlxs</a>.</p>

<ul>

<pre><code class="plaintext">I32  ix</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="RETVAL"><a class="permalink" href="perlapi.html#RETVAL">#</a><code>RETVAL</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to hold the return value for an XSUB. This is always the proper type for the XSUB. See <a href="perlxs.html#The-RETVAL-Variable">&quot;The RETVAL Variable&quot; in perlxs</a>.</p>

<ul>

<pre><code class="plaintext">type  RETVAL</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="ST"><a class="permalink" href="perlapi.html#ST">#</a><code>ST</code> </dt>
<dd>

<p>Used to access elements on the XSUB&#39;s stack.</p>

<ul>

<pre><code class="plaintext">SV*  ST(int ix)</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="THIS"><a class="permalink" href="perlapi.html#THIS">#</a><code>THIS</code> </dt>
<dd>

<p>Variable which is setup by <code>xsubpp</code> to designate the object in a C++ XSUB. This is always the proper type for the C++ object. See <code><a href="perlapi.html#CLASS">&quot;CLASS&quot;</a></code> and <a href="perlxs.html#Using-XS-With-C%2B%2B">&quot;Using XS With C++&quot; in perlxs</a>.</p>

<ul>

<pre><code class="plaintext">type  THIS</code></pre>

</ul>

</dd>
</dl>

<dl>

<dt id="UNDERBAR"><a class="permalink" href="perlapi.html#UNDERBAR">#</a><code>UNDERBAR</code> </dt>
<dd>

<p>The SV* corresponding to the <code>$_</code> variable. Works even if there is a lexical <code>$_</code> in scope.</p>

</dd>
</dl>

<dl>

<dt id="XS1"><a class="permalink" href="perlapi.html#XS1">#</a><code>XS</code> </dt>
<dd>

<p>Macro to declare an XSUB and its C parameter list. This is handled by <code>xsubpp</code>. It is the same as using the more explicit <code>XS_EXTERNAL</code> macro; the latter is preferred.</p>

</dd>
</dl>

<dl>

<dt id="XS_EXTERNAL"><a class="permalink" href="perlapi.html#XS_EXTERNAL">#</a><code>XS_EXTERNAL</code> </dt>
<dd>

<p>Macro to declare an XSUB and its C parameter list explicitly exporting the symbols.</p>

</dd>
</dl>

<dl>

<dt id="XS_INTERNAL"><a class="permalink" href="perlapi.html#XS_INTERNAL">#</a><code>XS_INTERNAL</code> </dt>
<dd>

<p>Macro to declare an XSUB and its C parameter list without exporting the symbols. This is handled by <code>xsubpp</code> and generally preferable over exporting the XSUB symbols unnecessarily.</p>

</dd>
</dl>

<dl>

<dt id="XSPROTO"><a class="permalink" href="perlapi.html#XSPROTO">#</a><code>XSPROTO</code> </dt>
<dd>

<p>Macro used by <code><a href="perlapi.html#XS_INTERNAL">&quot;XS_INTERNAL&quot;</a></code> and <code><a href="perlapi.html#XS_EXTERNAL">&quot;XS_EXTERNAL&quot;</a></code> to declare a function prototype. You probably shouldn&#39;t be using this directly yourself.</p>

</dd>
</dl>

<h1 id="Undocumented-elements"><a class="permalink" href="perlapi.html#Undocumented-elements">#</a><a id="Undocumented"></a>Undocumented elements</h1>

<p>The following functions have been flagged as part of the public API, but are currently undocumented. Use them at your own risk, as the interfaces are subject to change. Functions that are not listed in this document are not intended for public use, and should NOT be used under any circumstances.</p>

<p>If you feel you need to use one of these functions, first send email to <a href="mailto:perl5-porters@perl.org">perl5-porters@perl.org</a>. It may be that there is a good reason for the function not being documented, and it should be removed from this list; or it may just be that no one has gotten around to documenting it. In the latter case, you will be asked to submit a patch to document the function. Once your patch is accepted, it will indicate that the interface is stable (unless it is explicitly marked otherwise) and usable by you.</p>

<p>                                   </p>

<ul>

<pre><code class="plaintext">amagic_call        gv_name_set            PerlIO_fill
amagic_deref_call  gv_SVadd               PerlIO_unread
any_dup            he_dup                 pmop_dump
atfork_lock        hek_dup                pop_scope
atfork_unlock      hv_delayfree_ent       pregfree
block_gimme        hv_eiter_p             ptr_table_fetch
call_atexit        hv_eiter_set           ptr_table_free
call_list          hv_free_ent            ptr_table_new
clear_defarray     hv_ksplit              ptr_table_split
clone_params_del   hv_name_set            ptr_table_store
clone_params_new   hv_placeholders_get    push_scope
CvDEPTH            hv_placeholders_set    re_compile
deb                hv_rand_set            regdump
deb_nocontext      hv_riter_p             repeatcpy
debop              hv_riter_set           rsignal_state
debprofdump        init_stacks            rvpv_dup
debstack           init_tm                save_adelete
debstackptrs       is_lvalue_sub          save_aelem
dirp_dup           leave_scope            save_aelem_flags
do_aspawn          magic_dump             save_alloc
do_close           markstack_grow         save_generic_pvref
do_join            mfree                  save_generic_svref
do_open            mg_dup                 save_hdelete
do_openn           mg_size                save_helem
doref              mro_get_from_name      save_helem_flags
do_spawn           mro_set_mro            save_hints
do_spawn_nowait    my_chsize              save_op
do_sprintf         my_cxt_init            save_padsv_and_mortalize
dounwind           my_dirfd               save_pushi32ptr
dowantarray        my_failure_exit        save_pushptr
dump_eval          my_fflush_all          save_pushptrptr
dump_form          my_fork                save_set_svflags
dump_mstats        my_pclose              save_shared_pvref
dump_sub           my_popen               savestack_grow
filter_del         my_popen_list          savestack_grow_cnt
fp_dup             my_socketpair          save_vptr
get_context        newANONATTRSUB         scan_vstring
get_mstats         newANONHASH            seed
get_op_descs       newANONLIST            set_context
get_op_names       newANONSUB             share_hek
get_ppaddr         newAVREF               si_dup
get_vtbl           newCVREF               ss_dup
gp_dup             newFORM                start_subparse
gp_free            newGVgen               sv_2pvbyte_flags
gp_ref             newGVgen_flags         sv_2pvutf8_flags
gv_add_by_type     newGVREF               SvAMAGIC_off
Gv_AMupdate        newHVhv                SvAMAGIC_on
gv_autoload_pv     newHVREF               sv_dup
gv_autoload_pvn    newIO                  sv_dup_inc
gv_autoload_sv     newMYSUB               sv_peek
gv_AVadd           newPROG                sys_intern_clear
gv_dump            new_stackinfo          sys_intern_dup
gv_efullname3      newSVREF               sys_intern_init
gv_efullname4      op_refcnt_lock         taint_env
gv_fullname3       op_refcnt_unlock       taint_proper
gv_fullname4       parser_dup             unsharepvn
gv_handler         perl_alloc_using       vdeb
gv_HVadd           perl_clone_using       
gv_IOadd           PerlIO_context_layers  </code></pre>

</ul>

<h1 id="AUTHORS"><a class="permalink" href="perlapi.html#AUTHORS">#</a>AUTHORS</h1>

<p>Until May 1997, this document was maintained by Jeff Okamoto &lt;okamoto@corp.hp.com&gt;. It is now maintained as part of Perl itself.</p>

<p>With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer, Stephen McCamant, and Gurusamy Sarathy.</p>

<p>API Listing originally by Dean Roehrich &lt;roehrich@cray.com&gt;.</p>

<p>Updated to be autogenerated from comments in the source by Benjamin Stuhl.</p>

<h1 id="SEE-ALSO"><a class="permalink" href="perlapi.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p><i>config.h</i>, <a href="perlapio.html">perlapio</a>, <a href="perlcall.html">perlcall</a>, <a href="perlclib.html">perlclib</a>, <a href="perlfilter.html">perlfilter</a>, <a href="perlguts.html">perlguts</a>, <a href="perlintern.html">perlintern</a>, <a href="perlinterp.html">perlinterp</a>, <a href="perliol.html">perliol</a>, <a href="perlmroapi.html">perlmroapi</a>, <a href="perlreguts.html">perlreguts</a>, <a href="perlxs.html">perlxs</a></p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
